Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

if with a variable

Hi all,

I have a problem with the following skript:

if ($(Menu) = 1,

sum (Stunden where Reiszeit = 'Nein'),         // only Stunden with "Nein"

sum (Stunden)) as Stunden_Projekt             // all Stunden

I would like to controll the two different sums per variable.

The problem is that I don't get the right skript for this.

Thank you for helping

14 Replies
MayilVahanan

HI

Can u post a sample file?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

Unfortunately no, as this is part of a huge file with to much data.

My aim is to switch the sum-function between all "Stunden" and the "Stunden" which have also Reisezeit = "Nein"

Example:

Nr.    Reisezeit    Stunden

1           Nein               5

2          Nein               5

3               Ja               5

4               Ja               5

Variable = menu:

menu = 1 =>sum Stunden = 20

menu = 0 => sum Stunden = 10

For setting menu 1 or 0 I have a slider in the design-part to switch.

Doesn't this help?

Thank you for helping

MayilVahanan

HI

PFA

Regards,

R.Mayil Vahanan

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

Hi,

thank u very much for your solution.

How can use this in the script?

I want to use the slider to controll a variable in my script. Is this also possible?

Thank u very much

Anonymous
Not applicable
Author

How can I use this in the script, as I need the results for further calculations?

Thank u very much!