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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
helge_jorg
Creator
Creator

Count days in row when measure is grater than 0

Qlik experts,

I would like to count days in row where the measure is grater greater than zero.

When a day is lower than zero, the count should be restarted so that the KPI is only showing days in row when the measure is greater than zero.

I need help to create a new set analysis that will count the days in row with a measure greater than zero. This should be used in a KPI.

Here is the set analysis I currently use for count days with measure greater than 0. This set analysis returns days with a measure greater than zero for entire 2018. Is it possible to restart the count if one day has a measure lower or = to zero?

count({$<[Vaerdata.Verdi]={">0"}, ElementID={'RR'},Year= {'2018'}>} [Vaerdata.Verdi])

Cheers,

Helge

10 Replies
helge_jorg
Creator
Creator
Author

176 i correct for the entire 2018, but the lowermost KPI (in the image above), with the aggr- formula you gave me does not show any results.

The first set-analysis return 176; count({<[Vaerdata.Verdi]= {">0"}, ElementID = {'RR'}, Year= {'2018'}>} [Vaerdata.Verdi])

The lower one, with aggr, is not giving any value, only -

Aggr(count({<[Vaerdata.Verdi]= {">0"}, ElementID = {'RR'}, Year= {'2018'}>} [Vaerdata.Verdi]), [Vaerdata.Verdi])