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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count from last timestamp?

How do you create an expression to get a count of last timestamp of ID for each LEVEL and RISK from the table below?

TIMESTAMPIDLEVELRISK
7/23/2012126496
7/24/2012128895
7/24/2012135726
7/24/2012135726
7/24/2012183316
7/25/2012136626
7/26/2012122294
7/27/2012122236
7/28/2012288926
7/30/2012288926
7/31/2012677726

I would expect to get the following counts:

LEVEL=1 RISK=6 ====> COUNT=1

LEVEL=2 RISK=6 ====> COUNT=4

etc...

Labels (1)
6 Replies
Not applicable
Author

try:

count(aggr(max(TIMESTAMP),ID,LEVEL,RISK))

Not applicable
Author

I need to add one more step, how would I update this expression if I wanted to count only if LEVEL=2?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

try: count(aggr(max({$<[LEVEL]={'2'}>} TIMESTAMP),ID,LEVEL,RISK))


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you this works now!

Not applicable
Author

Thank you this works now!

Not applicable
Author

Thank you this works now!