Why both Expression Not work

Only the first expression is working. The second expression is not working expression. Can you tell where I made a mistake? 

 

 

 

 

 

IFS(IN([_THIS],SELECT(CAMPUS SCAN SHEET[AWB NO],[AWB NO]=[_THIS].[AWB NO])),"Already Scanned This Shipment"),Not(OR(

 

  CONTAINS([_This], "CRP"),

 

  CONTAINS([_This], "~"),

 

  CONTAINS([_This], "`"),

 

  CONTAINS([_This], "!"),

 

  CONTAINS([_This], "@"),

 

  CONTAINS([_This], "#")

 

  CONTAINS([_This], "£"),

 

  CONTAINS([_This], "€"),

 

  CONTAINS([_This], "$"),

 

  CONTAINS([_This], "¥"),

 

  CONTAINS([_This], "%"),

 

  CONTAINS([_This], "&")),"Re-scan AWN No")

0 8 137
8 REPLIES 8

A brotherly advice, in almost all of your questions you are making it very hard for people to help you. Kindly always :

  1. Please always show the context. In what field you have this expression, in which column in which table. 

  2. Please do not just ask about an expression or why you have this or that. Please explain in details what do you want to do, what would you like to achieve.

  3. Please do not say "this is not working"; this phrase has no meaning. You should instead say, I expected this to give me that result, but instead I'm getting this result, or I'm expecting to have this behavior but I'm getting this error. 

  4. Please, always post screenshots of your tables and column configuration. You have to be keen to save the time of others who are willing to help you.

  5. Please make sure your screenshots are of an acceptable quality and readable. If you post small images that you cannot read any text in them, others will not be able to read them either. 

  6. As @graham_howe suggested, when writing expressions, please indent your code correctly while you are writing the expressions. You'll be able then to easily discover any syntax or semantic errors in your code. 


Instead of posting the same question repeatedly in more posts, please focus on enhancing how you write your questions. Thank you much!

If I speak in simple language, then two error messages have to be shown. Is it possible from a single column?

 

I don't know as much English as you. 

As well as the excellent suggestions @Joseph_Seddik made so that it will be easier for us to help you, I would also add that it is much easier for everyone, including the developer, if you indent your code correctly. I took your expression, and just formatted it with correct indentation, it is fairly obvious why this is not working:

IFS(
  IN(
    [_THIS],
    SELECT(
      CAMPUS SCAN SHEET[AWB NO],
      [AWB NO]=[_THIS].[AWB NO]
    )
  ),
  "Already Scanned This Shipment"
),
Not(
  OR(
    CONTAINS([_This], "CRP"),
    CONTAINS([_This], "~"),
    CONTAINS([_This], "`"),
    CONTAINS([_This], "!"),
    CONTAINS([_This], "@"),
    CONTAINS([_This], "#")
    CONTAINS([_This], "£"),
    CONTAINS([_This], "€"),
    CONTAINS([_This], "$"),
    CONTAINS([_This], "¥"),
    CONTAINS([_This], "%"),
    CONTAINS([_This], "&")
  ),
  "Re-scan AWN No"
)

 

Show More
The NOT() expression is outside of the IFS() expression.

 

Why is the second expression not showing up?

 

Capture.PNG

Probably because you still haven't corrected the problem I pointed out above. However this is a guess because yet again you give us no details. We can't see the expression, we don't know the data structure and you haven't told us what you want to achieve.

Second Expression not work.

 

IFS(
  IN(
    [_THIS],
    SELECT(
      CAMPUS SCAN SHEET[AWB NO],
      [AWB NO]=[_THIS].[AWB NO]
    )
  ),
  "Already Scanned This Shipment"
),
Not(
  OR(
    CONTAINS([_This], "CRP"),
    CONTAINS([_This], "~"),
    CONTAINS([_This], "`"),
    CONTAINS([_This], "!"),
    CONTAINS([_This], "@"),
    CONTAINS([_This], "#")
    CONTAINS([_This], "£"),
    CONTAINS([_This], "€"),
    CONTAINS([_This], "$"),
    CONTAINS([_This], "¥"),
    CONTAINS([_This], "%"),
    CONTAINS([_This], "&")
  ),
  "Re-scan AWN No"
)

Note: This expression could impact performance.

IFS(
....(The value of column 'GATE ENTRY NO') is one of the values in the list (The list of values of column 'AWB NO'
........from rows of table 'CAMPUS SCAN SHEET'
........where this condition is true: ((The value of column 'AWB NO') is equal to (The value of 'AWB NO' from the row referenced by 'GATE ENTRY NO')))
...."Already Scanned This Shipment")

@graham_howe  @Joseph_Seddik 

 

You still didn't move the second half of your expression inside the IFS function, try this:

IFS(
  IN(
    [_THIS],
    SELECT(
      CAMPUS SCAN SHEET[AWB NO],
      [AWB NO]=[_THIS].[AWB NO]
    )
  ),
  "Already Scanned This Shipment",
  NOT(
    OR(
      CONTAINS([_This], "CRP"),
      CONTAINS([_This], "~"),
      CONTAINS([_This], "`"),
      CONTAINS([_This], "!"),
      CONTAINS([_This], "@"),
      CONTAINS([_This], "#")
      CONTAINS([_This], "£"),
      CONTAINS([_This], "€"),
      CONTAINS([_This], "$"),
      CONTAINS([_This], "¥"),
      CONTAINS([_This], "%"),
      CONTAINS([_This], "&")
    )
  ),
  "Re-scan AWN No"
)

 

@graham_howe Show More, hilarious 🙂

I've added your point in the list. Thank you!

Top Labels in this Space