Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Line Chart according to latest Top 5 Position

Hi All,

I would like to draw a Line Chart according to Jun16 position's Top 5 value.

I go to the Chart properties (Dimension Limits) tab, select 'Show Only', Largest 5 values.

The result wasn't what i expected, it displayed the Top 5 value for each of the month.

How do i draw a Line Chart according to Jun16 position's Top 5 value (i.e. Line should only appreared for Type A, D, F, H, I)?

   

TYPEJun15Jul15Aug15Sep15Oct15Nov15Dec15Jan16Feb16Mar16Apr16May16Jun16
Type A95496510481097107110561063102010309649611015976
Type B426432467518516521526520521498497870848
Type C328333365436424419136840846460449
Type D1191119230713208316631143140301730922976298030803058
Type E630629665689583563562482477438428440423
Type F4185423345664601449444197994787479047634762077264799
Type G655656698728700712476451238219219228234
Type H6036056576796702152142001971891923241117
Type I1451143414911542146313821370131312331148114611891150
1 Solution

Accepted Solutions
effinty2112
Master
Master

Hi Jin,

              I think this is what you want:

Chart.JPG

The first thing to do is get your data in tabular form:

CrossData:

LOAD TYPE,

    Jun15,

    Jul15,

    Aug15,

    Sep15,

    Oct15,

    Nov15,

    Dec15,

    Jan16,

    Feb16,

    Mar16,

    Apr16,

    May16,

    Jun16

FROM

[https://community.qlik.com/thread/233701]

(html, codepage is 1252, embedded labels, table is @1);

Data:

CrossTable(Month,Sales) LOAD * Resident CrossData;

Drop Table CrossData;

Now the data is in three columns, TYPE, Month and Sales,

Make your line chart with the dimension Month and a calculated dimension I've called Type:

=Aggr(if(Rank(Sum({$<Month = {'Jun16'}>}Sales)) <=5,TYPE),TYPE)

In the chart's dimension tab check the option Suppress When Value Is Null for this calculated dimension.

Add the expression Sum(Sales)

and in the Sort tab set the Month field sort order to Numeric Value Ascending.

Good luck

Andrew

View solution in original post

6 Replies
Gysbert_Wassenaar

Please post a small qlikview document with example data.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi, here is the sample data.

miguelbraga
Partner - Specialist III
Partner - Specialist III

Is this what you're looking for?

See the attached file

Best regards,

D.A. MB

Anonymous
Not applicable
Author

Hi, refer to attachment below. Graph A is the result i want instead of Graph B.

Graph A

Graph B

effinty2112
Master
Master

Hi Jin,

              I think this is what you want:

Chart.JPG

The first thing to do is get your data in tabular form:

CrossData:

LOAD TYPE,

    Jun15,

    Jul15,

    Aug15,

    Sep15,

    Oct15,

    Nov15,

    Dec15,

    Jan16,

    Feb16,

    Mar16,

    Apr16,

    May16,

    Jun16

FROM

[https://community.qlik.com/thread/233701]

(html, codepage is 1252, embedded labels, table is @1);

Data:

CrossTable(Month,Sales) LOAD * Resident CrossData;

Drop Table CrossData;

Now the data is in three columns, TYPE, Month and Sales,

Make your line chart with the dimension Month and a calculated dimension I've called Type:

=Aggr(if(Rank(Sum({$<Month = {'Jun16'}>}Sales)) <=5,TYPE),TYPE)

In the chart's dimension tab check the option Suppress When Value Is Null for this calculated dimension.

Add the expression Sum(Sales)

and in the Sort tab set the Month field sort order to Numeric Value Ascending.

Good luck

Andrew

Gysbert_Wassenaar

Try this expression: Sum({<Type={"=rank(sum({<Date={'30/06/2016'}>}Amount))<=5"}>}Amount)

Or perhaps this one: Sum({<Type={"=rank(sum({<Date={'$(=Date(max(Date)))'}>}Amount))<=5"}>}Amount)


talk is cheap, supply exceeds demand