More than 24 entry of one value

I want that there should not be more than 24 entry of one value. 

can you explain how can i do that. 

shelf codeshelf code

Solved Solved
0 9 142
1 ACCEPTED SOLUTION

OK, thank you! Sorry I didn't know about this behavior of the expression assistant. Please, try this:

NOT(
  COUNT(
    FILTER(CAMPUS SCAN SHEET, [Shelf Code] = [_This]) - LIST([_ThisRow])
  ) > 24

View solution in original post

9 REPLIES 9

Valid if

NOT( COUNT( FILTER(table, [Shelf Code] = [_This]) - [_ThisRow] ) > 24 ) 
  

NOT( COUNT( FILTER(CAMPUS SCAN SHEET, [Shelf Code] = [_This]) - [_ThisRow] ) > 24 ) 

Arithmetic expression '(SELECT(CAMPUS SCAN SHEET[GATE ENTRY NO],([Shelf Code] = [_This]))-[_ThisRow])' has inputs of an invalid type 'Unknown'

Why aren't you using the same expression I gave you? 

The function you have given. He's not working. Showing error. 

Oh, really? 


@Sayad wrote:

 

 

NOT( COUNT( FILTER(CAMPUS SCAN SHEET, [Shelf Code] = [_This]) - [_ThisRow] ) > 24 )
(SELECT(CAMPUS SCAN SHEET[GATE ENTRY NO],([Shelf Code] = [_This]))-[_ThisRow])

 

 

Do they look the same to you? 

OK, thank you! Sorry I didn't know about this behavior of the expression assistant. Please, try this:

NOT(
  COUNT(
    FILTER(CAMPUS SCAN SHEET, [Shelf Code] = [_This]) - LIST([_ThisRow])
  ) > 24

Hi @Joseph_Seddik

Can you explain where i mistake in function.

 

IFS(
  NOT(NOT(
  COUNT(
    FILTER(CAMPUS SCAN SHEET, [Shelf Code] = [_This]) - LIST([_ThisRow])
  ) >= 24,"Duplicate Shelf Code",

  NOT(OR(
  AND(
    startswith([SHELF CODE],"MCOP-"),
    LEN([SHELF CODE]) = 8
  ),
  AND(
    startswith([SHELF CODE],"MCUP-"),
    LEN([SHELF CODE]) = 8
  ),
  AND(
    startswith([SHELF CODE],"FKSOP-"),
    LEN([SHELF CODE]) = 9
  ),
AND(
    startswith([SHELF CODE],"FKSUP-"),
    LEN([SHELF CODE]) = 9
),AND(
    startswith([SHELF CODE],"HOLD"),
    LEN([SHELF CODE]) = 7),
AND(
    startswith([SHELF CODE],"ADJUST"),
    LEN([SHELF CODE]) = 11),
AND(
    startswith([SHELF CODE],"MD-"),
    LEN([SHELF CODE]) = 5)))
),"Invalid Shelf code"
))))

 

Try this: 

IFS(
  NOT(
    COUNT(
      FILTER(CAMPUS SCAN SHEET, [Shelf Code] = [_This]) - LIST([_ThisRow])
    ) >= 24
  ), "Duplicate Shelf Code",
  NOT(
    OR(
      AND(
        STARTSWITH([SHELF CODE],"MCOP-"),
        LEN([SHELF CODE]) = 8
      ),
      AND(
        STARTSWITH([SHELF CODE],"MCUP-"),
        LEN([SHELF CODE]) = 8
      ),
      AND(
        STARTSWITH([SHELF CODE],"FKSOP-"),
        LEN([SHELF CODE]) = 9
      ),
      AND(
        STARTSWITH([SHELF CODE],"FKSUP-"),
        LEN([SHELF CODE]) = 9
      ),
      AND(
        STARTSWITH([SHELF CODE],"HOLD"),
        LEN([SHELF CODE]) = 7
      ),
      AND(
        STARTSWITH([SHELF CODE],"ADJUST"),
        LEN([SHELF CODE]) = 11
      ),
      AND(
        STARTSWITH([SHELF CODE],"MD-"),
        LEN([SHELF CODE]) = 5
      )
    )
  ), "Invalid Shelf code",
  TRUE, "Unknown error."
)

Top Labels in this Space