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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
yuvraj_33
Partner - Contributor III
Partner - Contributor III

One Dimension value static & other variable in TOP analysis

Hi All,

I have this query wherein I need to implement a top 5 analysis in bar chart where one value is static & others vary as per selections.

e.g.: Suppose I have 10 materials as follows.

-----------------------------------------

Material    |    Sale

-----------------------------------------

      Pen     -    40

    Pencil    -    30

    Eraser   -    60

Sharpener  -    70

    Colors   -    50

  Palette    -    10

Notebook  -    20

Textbook  -    100

    Brush   -    80

Compass  -    90

-----------------------------------------

I need to show top 5 Sale for Materials as Colors + Top 5 which makes overall 6 values.

Here, Material = 'Colors' should be constant & Top 5 from remaining  9 materials.

So, as per requirement the output should be in following sequence in a bar chart:

1. Colors      -     50

2. Textbook  -     100

3. Compass  -     90

4. Brush       -     80

5. Sharpener -     70

6. Eraser      -     60

Please suggest over the same.

Labels (1)
2 Replies
swuehl
Champion III
Champion III

Dimension: Material

Expression:

=Sum({<Material = {'Colors'} +{"=Rank(Sum({<Material -= {'Colors'}>} SaleField))<=5"} >} SaleField)

yuvraj_33
Partner - Contributor III
Partner - Contributor III
Author

Thank you swuehl, its working...