Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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.

2 Replies
swuehl
MVP
MVP

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