Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Find max count using class function

I have a bar graph where my dimension is the following to make 30  min time buckets create_time

class(create_time,60*30)

My measure is

count(id)

Which will give me the totals for each time bucket and it works.

Now I want to display the highest total using the KPI chart type and for the life of me can't figure out the formula I need.

1 Solution

Accepted Solutions
sunny_talwar

I suggest creating this in the script

LOAD class(create_time,60*30) as create_time_class

and then this

Max(Aggr(Count(id), create_time_class))

View solution in original post

6 Replies
sunny_talwar

I suggest creating this in the script

LOAD class(create_time,60*30) as create_time_class

and then this

Max(Aggr(Count(id), create_time_class))

Anonymous
Not applicable
Author

We're hoping to avoid that and use class as its more flexible and we could adjust the size of the buckets with out re-loading the data.

sunny_talwar

Would you be able to share a sample to play around with?

Anonymous
Not applicable
Author

I'm new to this. It's an internal application and I'm unsure of other ways to share a sample.

sunny_talwar

Mock up data which is close to your real scenario

Anonymous
Not applicable
Author

Oh. Very simply broken down the following table has create time in seconds.

ID,CREATE_TIME
1,0

1,60

2,1800

3,3600

4,3601

5,3602


It should results in a graph that has 2 in the first column, 1 in the second and 3 in the third.

The KPI should display the maximum count for those buckets in this case 3.