Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

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
Highlighted

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
Highlighted

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

Highlighted
Contributor II
Contributor II

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.

Highlighted

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

Highlighted
Contributor II
Contributor II

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

Highlighted

Mock up data which is close to your real scenario

Highlighted
Contributor II
Contributor II

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.