Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get the Max Value for Consecutive Periods

Hello,

I have a table with ids and periods. I need to get the max value for the column consecutive periods.

I created a column named consecutive periods, but now I need to get the max value for the field consecutive periods for each id.

The thing is that I can't use the max function because the column consecutive periods is an expression and it shows me null values.

IMA_0001.jpg

What I need is to obtain a result like the following:

IMA_0002.jpg

I should have something like this, hiding the columns periods and consecutive periods using a simple table graphic:

IMA_0003.jpg

Notes:

I would need this as an expression in my table because the periods are dynamic and they vary according to a slider object.

Thanks for your help!

5 Replies
MK_QSL
MVP
MVP

Like This?

Not applicable
Author

I would use that solution if I had fixed periods.

But as I asked before, I have something like this with a slider object that make the periods dynamic:

IMA_0004.jpg

I attach the file with the slider object.

Thank you!

Not applicable
Author

David,

I found 1 more issue in v1, so there is v2.

Please let me know if my demo gives you expected results.

I'am still trying to find more elegant way to calculate your indicator....

regards

Darek

Not applicable
Author

You should use AGGR function and get the max.

Not applicable
Author

Pushpendra,

of course you are right.

But there is problem of counting number of Consecutve periods before this max.

Please look on my demo. I think, it gives good results, but expression is not very elegant. Maybe you will find better way?

regards

Darek