Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Value Passing By Variable

Hi all,

I have below mentioned requirement .

While doing what if analysis I need to show present energy loss by Slider object, On attached QVW it is not happening.

Is there any possibility to do that.

Thanks,

JK

7 Replies
Gysbert_Wassenaar

I have no idea what you're actually asking. See attached qvw for a guess to an answer.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gybert,

Whenever user opens the sheet slider should show the present energy loss %,For example by given in-line data the total energy loss is 23%, here slider should show 23% first.  Is it possible.

Thanks,

JK

Gysbert_Wassenaar

23% ? How do you get that number?

Total energy sales is 7461514

Total energy consumed is 7141734

Total energy loss is 319780

So where does the 23% come from?


talk is cheap, supply exceeds demand
Not applicable
Author

Sorry that was a mistake...it is not 23% . correct one is 4.28%, it is energy loss % form energy sales.

Gysbert_Wassenaar

Calculate the value in the script:

T1:

LOAD * INLINE [

    Category, Energy Sales, Energy Loss, Energy Consumed

    L1, 1393567, 70027, 1323540

    L2, 4962453, 48142, 4914311

    L3, 1105494, 201611, 903883

];

T2:

LOAD sum([Energy Loss])/sum([Energy Consumed]) as [Perc Energy Loss]

Resident T1;

LET vEnergyLoss = round(peek('Perc Energy Loss')*100,0.1);

DROP TABLE T2;


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

I am almost there, I got the slide bar result right. But as below mentioned image those two column values should be identical before doing the slide bar selection. PFA QVW.Screenshot (15).png. !

Gysbert_Wassenaar

That is impossible. The What-if expression uses the variable and you want the variable to have the initial value of the loss percentage. You cannot have it both ways. Or the variable is zero and the What-if values are as you require or the variable is initialized like you want and the what-if values are calculated accordingly.


talk is cheap, supply exceeds demand