Reputation: 35
I am new to qlik sense, I have a data say - 'data', it contains four columns - 'name', 'amount', 'category', 'mode'
'name' is basically customers name, 'amount' is total spent, 'category' is like - cloths, foods, gadgets and 'mode' is offline or online.
I have created a drill down bar chart with x axis as - name/category (drill down) and y axis as amount(sum). I need to show the count of repetition in two kpi charts of mode upon selecting a particular bar
for eg - If I select the bar of foods, the kpi will show offline - 32, online -7 based on the selection I made i.e., foods
I have tried - Count({<mode={'offline'}>}mode)
but it's not working. Any help will be appreciated.
Upvotes: 0
Views: 914
Reputation: 5012
When using drill-down Qlik is actually selecting the values, which are "drilled". You can see that selections are made in the selection bar.
You can build the KPI objects based on the number of selected values into the drill-down fields.
GetSelectedCount function will return the number of distinct selected values in a field. The function will return 0 if nothing is selected.
An example expression:
= if(GetSelectedCount(category) > 0,
count( {<mode = {'offline'} >} category),
if(GetSelectedCount(name) > 0 ,
count( {<mode = {'offline'} >} name),
count( {<mode = {'offline'} >} SomethingElse // if nothing is selected in "name" and "category" fields
))
)
Upvotes: 1