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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Question on Set Analysis interaction with user selection

I have a table like this

DeptTypeManager
FinanceTempA
FinanceEmployeeA
FinanceEmployeeB
FinanceEmployeeB
FinanceTempA
SalesTempC
SalesEmployeeC
SalesEmployeeD
SalesEmployeeD
SalesEmployeeD


and I would like to show in text field the % breakdown by Employee Type for a department

I use this formula to compute the % :

% Employee in Sales dept : Count({$<Dept={Sales}, Type={Employee}>} Type) / Count({$<Dept={Sales} TOTAL Type) = 4/5=80%

% Temp in Sales dept        : Count({$<Dept={Sales}, Type={Temp}>} Type) / Count({$<Dept={Sales} TOTAL Type) = 1/5= 20%

So far so good.  However, when a selection is made on the Type listbox, , the above computations no longer work. i.e. if I were to select Temp in the Type list box, the above computation will show 400% ( 4 /1 ) and 100% (1/1) when the correct result should be 0% and 100%.

How do I modify the set analysis formula to take into account the selected value ?

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Please find attached file for solution.

Regards,

Jagan.

View solution in original post

2 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Please find attached file for solution.

Regards,

Jagan.

Anonymous
Not applicable
Author

Thanks !

I learnt 2 new useful functions - GetFieldSelections() and GetSelectedCount()