Unify two filters in one Beast mode function ?

Hello,

In a card, I edited a Beast Mode function in order to combine two filters:

  • (case when (`Distributors`='DistributorA' and `Country`='CountryA') then 'Distributors'

else 0

end)

  • (case when (`Country`='CountryB') then 'Distributors'

else 0

end)

I would like to combine these two in one unique Beast Mode function like a UNION function or a + function, however I can't find the good syntax for that.


Thank you in advance.

Best Answers

  • MarkSnodgrass
    Answer ✓

    You would just create multiple WHEN statements. You can have as many WHEN statements as you want in a CASE statement. Yours would look like this:

    (case when (`Distributors`='DistributorA' and `Country`='CountryA') then 'Distributors'

    when (`Country`='CountryB') then 'Distributors'

    else 0

    end)

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • MarkSnodgrass
    Answer ✓

    @Gor_Gonzalez , you're welcome! If you can mark the answer as accepted, it will help others in the community.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.

Answers

  • MarkSnodgrass
    Answer ✓

    You would just create multiple WHEN statements. You can have as many WHEN statements as you want in a CASE statement. Yours would look like this:

    (case when (`Distributors`='DistributorA' and `Country`='CountryA') then 'Distributors'

    when (`Country`='CountryB') then 'Distributors'

    else 0

    end)

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • Thank you Mark for your help !

  • MarkSnodgrass
    Answer ✓

    @Gor_Gonzalez , you're welcome! If you can mark the answer as accepted, it will help others in the community.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.