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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

when if and aggr(count) are used together....!

Hey guys

This Expression Worked fine:

Aggr(Count({$<[Field_Name1]={"*New*", "*Work*"}>}[Field_ID]),[Field_Priority])

but why would it not work when I put it in an if statement. like this:

If([Field_Create_Date]<= vToDate, Aggr(Count({$<[Field_Name1]={"*New*", "*Work*"}>}[Field_ID]),[Field_Priority]))

where vToDate is a variable created by me. vToDate = Date(Today(),'MM/DD/YYYY')

There could be two cases where it had failed. The 'if' statement or the variable definition. Can any one of you guys help me finding out where i went wrong..........

many thanks guys

1 Solution

Accepted Solutions
pover
Partner - Master
Partner - Master

Since there is a Field_Create_Date for every Field_Priority try

Aggr(Count({$<[Field_Name1]={"*New*", "*Work*"}>} If([Field_Create_Date]<= vToDate, [Field_ID])),[Field_Priority])

Regards.

View solution in original post

2 Replies
pover
Partner - Master
Partner - Master

Since there is a Field_Create_Date for every Field_Priority try

Aggr(Count({$<[Field_Name1]={"*New*", "*Work*"}>} If([Field_Create_Date]<= vToDate, [Field_ID])),[Field_Priority])

Regards.

Not applicable
Author

Works like a charm. Thank you very much!