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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
EugenioAccornero
Contributor III
Contributor III

Limit Line Graph (formula based)

Hi!

I'm trying to figure out how is possible to customize the limit for a line chart according to a specific formula;
Here is my problem:

I've built a line chart:

- Group (X axis): Dates (Month+Year)

- Measure (Y axis): Count(Event)

Then I've multiple lines, one for each "Component"

What I need to do, is to limit the number of lines shown to 5; I've tried to do it from the menu, by setting the limitation to the first 5 integer value but the result obtained is not the expected one; In this way for each date the graph return the top 5 "Component" according to the Measure formula... However what I need is to show for all the dates the same 5 "Component" which are defined according a "total" formula...

How can I do it?

Thanks!

Labels (1)
1 Solution

Accepted Solutions
Nicole-Smith

If you make your dimension for Component look something like the below, I think it should work.  So you would have:

Dimension 1: Date
Dimension 2: =if(aggr(Rank(Count(Event), Component), Component)<=5, Component)
Measure: Count(Event)

View solution in original post

2 Replies
Nicole-Smith

If you make your dimension for Component look something like the below, I think it should work.  So you would have:

Dimension 1: Date
Dimension 2: =if(aggr(Rank(Count(Event), Component), Component)<=5, Component)
Measure: Count(Event)

EugenioAccornero
Contributor III
Contributor III
Author

Thanks!

It worked perfectly!