Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
anushree1
Specialist II
Specialist II

Dynamic What if Analysis in Qlik Sense

HI ,

I want to get the what if analysis with dynamic number of variables based on user input and selection.

So in the attached Excel there are 2 Divisions A and B

If A is Selected the user must be shown its corresponding variables abc,def, ghi along with a input box so that they may enter any %value

So if User has entered 2% and 3% in def and ghi , then I must show a chart like below

A      100(Value in sheet2)*1(as no value is entered by user in the input box for abc)*0.2*0.3

Similarly if user Selects B , user must be shown its corresponding values def,ghi, mno,pqr along with a input box so that they may enter any %value

Now if user enters 2% and 5% for mno and pqr , then chart must have values like below:

B     200(Value in Sheet2)*1*1*0.2*0.5

 

Please guide me on how to get this in Qlik Sense

7 Replies
anushree1
Specialist II
Specialist II
Author

Any suggestions? @Vegar , @sunny_talwar ,  @kaushiknsolanki 

Vegar
MVP
MVP

Try expressions like this:

SUM({<Item = {'A'}>}Sales)* alt(num('$(abc)'),1) * alt(num('$(def)'),1) *alt(num('$(ghi)'),1)

(See attached qvf)

 

anushree1
Specialist II
Specialist II
Author

Thanks for the response @Vegar , 

But what I need is that when division A is selected, user must see 3 input boxes to fill in the values for abc,def and ghi

Similarly if Division B is selected user should see 4 input boxes to fill in values for def,ghi,mno and pqr

But, in the attched qvf all the variables are set in backend and is not user input driven , also no matter what the selection is I am able to see all the variables abc,def,ghi,mno,pqr.

Hope I have explained clearly if not please let me know.

Also , I liked the way you have used the combination of alt and num to get 1 as value in case nothing is assigned to the variable.

Can you please explain the logic of using alt and num , I am not very clear on how its working, I tried using alt($(abc),1), but it throws error if abc variable value is not defined

 

 

sunny_talwar

I guess what you are asking for is the ability to show/hide objects based on selection. Based on my understanding, show/hide is not available in Qlik Sense by default, but you might be able to use an extension to do this. I have not tested this, but look at this thread -> Can Show/Hide is possible in qliksense? 

anushree1
Specialist II
Specialist II
Author

@sunny_talwar 

But how do I make sure that these are the variables to display based on the Division Selected.

I mean how do we connect the dots here as variables are standalone objects and cannot be linked so selection on the Front end will not ensure that desired set of variables must be made visible..

Hope I have explained well, if not please let me know 

sunny_talwar

I am not sure I follow, but I feel like it can be easily done based on Get functions in Qlik....

anushree1
Specialist II
Specialist II
Author

Thanks for the response @sunny_talwar ,

Few issues that I happened to encounter are:

There is no provision to write any functions on the Variable extension(it only has a provision to choose a variable from the drop down list) ,

 
 

so writing something like if(getfielselections(Div)='A',v_abc) would not be possible(Hope you were referring to the same)

Also, wiriting a If loop might be very tedious in case we have 15 Divisions and 40 Variables in the long run ,  also as it wont be dynamic any change in the data will not be accomodated.

Is there anything that you can suggest here