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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
prashantsanchet
Creator
Creator

Variable Storing Dimention not working as expected

Hi team,

I have a one requirement where

i will have a dropdown selctor like (Dynamic Dimention Name)  like Customer, Region, Country

The selected value will be stored into variable vDropdownSelector:

I will have a bar chart where  based on selection in drop down my dimension value will be change

and i have measure as sum(sales) .

1) What is the  best way to implement this in qliksense.

2) I have other requirement where i need to show the same bar chart but only that row if ( sum(margin) >=0)

I tried this but its not working as expected

vDashboardSelector :

if (vDropdownSelector,'Customer', [Customer] ,

if (vDropdownSelector,'Region', [Region],if (vDropdownSelector,'Country',[Country])))


Dimention: $(vDashboardSelecto)


Measure:

Sum({<"=(vDashboardSelector)" ={"=Sum([margin])>=0"} >}sales)

Please provide your valuable comments

i

3 Replies
jwjackso
Specialist III
Specialist III

I tried this in Qlik Sense:

Set vSelected='=GetFieldSelections(Dim)';

DData:

LOAD * Inline [

Dept,Amt

101,100

101,200

102,200

102,400

];

PData:

Load * Inline [

Prod,Amt

Computer,400

Phone,300

];

DList:

LOAD * Inline [

Dim

Dept

Prod

];

Capture1.PNG

prashantsanchet
Creator
Creator
Author

Hi ,

Thanks fro your reply. I have condition i measure like if Sum([margin])>=0" then only show t


This is not working as expected as  i am having following measure

Dimention: $(vDashboardSelecto)


Measure:

Sum({<"=(vDashboardSelector)" ={"=Sum([margin])>=0"} >}sales)

Please provide your valuable comments

jwjackso
Specialist III
Specialist III

The dimension should already be specified,  can you use an "If" statement.

=If(Sum([margin]) >= 0,Sum(sales),0)

Then suppress zeroes.