Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sushil353
Master II
Master II

how to calculate top 10 , top 20 defect count ??

Hi All,

I have four charts in a dashboard with same expression Sum (TOTAL_DEFECTS). Charts are "defect by operation", "defect by origin", "defect by time" and "defect by defect type".

i need to add a table/field to restrict the top 10 or top 20 or ALL defect for "defect by defect type" chart only. see the image below.

time.bmp

how would i achieve this functionality..

Thanks..

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    You can create a  inline table say like this.

    Top:

     load * inline [

     Top Entry

     TOP 10

     TOP 20

     ALL

     ];

     Now at variable vTop set value as '

     =if(GetFieldSelections(Top Entry) = 'TOP 10',10,

        if(GetFieldSelections(Top Entry) = 'TOP 20',20,100));

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    What kind of chart it is..? Meaning is it a bar chart, straight table ..?

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sushil353
Master II
Master II
Author

it is a line chart with two dimentions see the screen shot below

untitled.bmp

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    Create a variable say vTop. Set it to 10.

    Now create a input box for the same variable. Meaning here user will include the top 'n' value.

    Go to properties of chart -> Sort -> click on the dimension and sort it by 'Y Value'.

    -> Presentation -> at Max Visible No. type '=vTop'

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sushil353
Master II
Master II
Author

Thanks kaushik,

My 85 % problem is solved.. is it possible to provide only 3 options to user to select only TOP 10, TOP 20 or ALL.

In solution provide by you is good but user need to enter value and to select all defects user needs to enter *..

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    You can create a  inline table say like this.

    Top:

     load * inline [

     Top Entry

     TOP 10

     TOP 20

     ALL

     ];

     Now at variable vTop set value as '

     =if(GetFieldSelections(Top Entry) = 'TOP 10',10,

        if(GetFieldSelections(Top Entry) = 'TOP 20',20,100));

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sushil353
Master II
Master II
Author

Thanks Kaushik