
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Simple KPI COUNTIF
Hi All,
Apologies in advance if this is a basic question - but I want to create a KPI on my dashboard to count if products are <, = or > a certain age. The age is setup in my dataset as a calculated field (Date Authorised - Date Logged)
I have filters on the top of the dashboard, so not sure if I can use set analysis? My formula for the KPI is
count(distinct(Age<10))
But the number returned does not correspond with the data in a straight table. Any help/ info on where I'm going wrong much appreciated
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
you can do
sum(aggr(if(Age<10,1,0),product))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@lironbaram thank you 🙂 I never knew you had to aggregate and then sum to countif in Qlik. Much appreciated !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey @lironbaram
Apologies for this - looks like the formula is working but not counting all of the values that is corresponding in the straight table.
KPI is reading 3, but there are 14 samples in the straight table below.
'Age' is a calculated field and I am using =floor(Age) in the straight table as age is timestamped.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
try this :
sum(aggr(if(floor(max(Age))<10,1,0),product))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many many thanks @lironbaram , would not have gotten that on my own!
