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: 
Not applicable

Count If

Hi Team

Any chance you could help me with a count if expression.

I have a column called Priority which has the following results in it;

0-1 Days

2-6 Days

7+ Days

0-1 Days

I am looking for an expression that counts the number of each of the above.  So based on the above, count if "0-1 Days" would return a result of 2.

Hope you can help?

cheers


12 Replies
tresesco
MVP
MVP

Take priority as a dimension of a staright table, and use Count(Priority)  as an expression.

jagan
Partner - Champion III
Partner - Champion III

Hi,

In chart Select Priority as Dimension and use Count(Priority) as expression, hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hi Jagan

Thanks for the response however, Priority is not available as a dimension because it is the result of an expression in the straight table.  Does that make sense?

vikram_patro
Contributor III
Contributor III

Do want the result in a chart or at script level?

Not applicable
Author

In the chart

vikram_patro
Contributor III
Contributor III

Can you post a sample app?

tresesco
MVP
MVP

Hello Chris,

Try something like this:

count(If(Aggr(<Your condition to class>,<your dimension in chart>)))

Not applicable
Author

Hey all.

The two pictures below represent my;

  1. straight table, with the Days column and the Priority columns created using expressions.
  2. an excel view of what I am trying to get Qlikview to achieve.

For each site, I want to show the count of each priority.  I am really stuck so any help that I can make sense of would be great.

cheers

Straight Table.JPG.jpgPriority (By Site) - Excel.JPG.jpg

trappersw
Partner - Creator
Partner - Creator

Hi there,

You need 2 dimensions:

Site and you add priority as a calculated dimension (normally I would think you can reuse the expression from the straight table as a calculated dimension).

Then as an expression you put the formula of priority between brackets and put count() around it.

This works in the example I inlcuded.