Skip to main content

Example:

CASE WHEN YEAR("X"."y") >= 2019 THEN FILTER ROUND_DAY("X"."y") != ROUND_DAY("A"."b") OR ROUND_DAY("X"."y") != ROUND_DAY("M"."n")

OR ROUND_DAY("A"."b") != ROUND_DAY("M"."n") ELSE FILTER ROUND_DAY("A"."b") != 2019-01-01 OR ROUND_DAY("M"."n") != 2019-01-01 END

 

Neither CASE WHEN nor IF worked for me. I'm trying in a Component Filter, though a solution on a Sheet level could also solve my problem.

Hi @luis.magal ,

 

I would rewrite your filter to this form:

FILTER (... AND ... ) OR ( .... OR ...)

 

roughly:

FILTER (YEAR("X"."y") >= 2019 AND (ROUND_DAY("X"."y") != ROUND_DAY("A"."b") OR ROUND_DAY("X"."y") != ROUND_DAY("M"."n")

OR ROUND_DAY("A"."b") != ROUND_DAY("M"."n") ) OR (ROUND_DAY("A"."b") != 2019-01-01 OR ROUND_DAY("M"."n") != 2019-01-01)

 

I found that filters inside case when statements won't work, but a FILTER using AND/OR conditions will work.

 

Please let me know if this works!


Hi @luis.magal ,

 

I would rewrite your filter to this form:

FILTER (... AND ... ) OR ( .... OR ...)

 

roughly:

FILTER (YEAR("X"."y") >= 2019 AND (ROUND_DAY("X"."y") != ROUND_DAY("A"."b") OR ROUND_DAY("X"."y") != ROUND_DAY("M"."n")

OR ROUND_DAY("A"."b") != ROUND_DAY("M"."n") ) OR (ROUND_DAY("A"."b") != 2019-01-01 OR ROUND_DAY("M"."n") != 2019-01-01)

 

I found that filters inside case when statements won't work, but a FILTER using AND/OR conditions will work.

 

Please let me know if this works!

Thanks, Joos! It worked in 1 of the 2 situations, but the path is clearer.


Thanks, Joos! It worked in 1 of the 2 situations, but the path is clearer.

Let me know if you need help in situation #2 :)


Reply