Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ChanceyJoel
Contributor
Contributor

Count if or and

Hi, I am trying to filter a pie chart using an expression to count the Product IDs where ("Program" = "Math" or "Liberal Arts") and Graduation Date >= 10/1/2022.

I tried these expressions and none of them work. Any help welcome!

Attempt 1

=count({<Program={'Math'}>+<Program={'Liberal Arts'}>+<[Graduation Date]={">=$(=DATE(44835,'MM/DD/YYYY'))"}>}distinct [Product ID])

Attempt 2

=count({<Program={'Math'},Program={'Liberal Arts'},[Graduation Date]={">=$(=DATE(44835,'MM/DD/YYYY'))"}>}distinct [Product ID])

Attempt 3

if(Program='Math' and Program='Liberal Arts' and [Graduation Date]='{">=$(=DATE(44835,'MM/DD/YYYY'))"}',count(distinct [Product ID]),count(distinct[Product ID]))

Attempt 4

if((Program='Math' or Program='Liberal Arts') and [Graduation Date]='{">=$(=DATE(44835,'MM/DD/YYYY'))"}',count(distinct [Product ID]),count(distinct[Product ID]))

Labels (3)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

As below

 

=count({<

Program={'Math','Liberal Arts'}

, [Graduation Date]={">=$(=Date(Date#('10/1/2022','MM/DD/YYYY')))"}

>}distinct [Product ID])

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

1 Reply
vinieme12
Champion III
Champion III

As below

 

=count({<

Program={'Math','Liberal Arts'}

, [Graduation Date]={">=$(=Date(Date#('10/1/2022','MM/DD/YYYY')))"}

>}distinct [Product ID])

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.