Qlik Community

Qlik Sense App Development

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

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
david_____p
New 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

Re: Find max count using class function

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))

6 Replies

Re: Find max count using class function

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))

david_____p
New Contributor II

Re: Find max count using class function

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.

Re: Find max count using class function

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

david_____p
New Contributor II

Re: Find max count using class function

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

Re: Find max count using class function

Mock up data which is close to your real scenario

david_____p
New Contributor II

Re: Find max count using class function

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.

Community Browser