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

How to Create a variable with three fields and have drill down option.

Hi all,

I am new to Qlik Sense, i am working on a app where i have three fields Country,Region,State and City. I would like to store selected value in a Variable because depending on the selected value i have to show the Profits at that levels. I need to maintain Hierarchy, Profit at each level is Fixed(Country's profit is not equal to sum of all regions, it is Static value). So if i create a single variable that stores Selected value from Hierarchial dimension, then i can create a variable to show Profits.

Thanks in Advance.

5 Replies
sunilkumarqv
Specialist II
Specialist II

Hi Afroz,

Create a variable ,

vSelectfield = if (getselectedcount(Country)>0,Country, if (getselectedcount(Region)>0,Region,

if (getselectedcount(state)>0,state, if (getselectedcount(City)>0,City)))

balabhaskarqlik

May be this:

Pick(Match($(<Variable>),1,2,3),<Dim1>,<Dim2>,<Dim3>)

afroz_shaik
Contributor III
Contributor III
Author

Hi Sunil,

Thanks For your response.

But vSelectfield variable only gets first selected value in this case. If it keeps drill down vselectfield variable is not changing the value. Do you have any other idea?

afroz_shaik
Contributor III
Contributor III
Author

Hi Bhaskar,

Thanks for your response!!

what should be the variable here. As i am having a  hierarchical dimension field i cannot create variable on it.

balabhaskarqlik

So instead of variable, use dimension1 name and values, then may be it can work for you.