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

When condition in script for set variable

Hi all,

I just want to set my variable when a condition is true so I tried:

when $(aktuellerMulti)>=$(j) set rundungs = $(rundungs)#$(rundung);

Anyone knows why this doesnt work and has got a solution?

Thanks in advance !

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Generally it's done with an if then else statement:

if $(aktuellerMulti)>=$(j) then

     set rundungs = $(rundungs)#$(rundung);

end if

If that doesn't work you'll have to explain what you're trying to do and how, i.e post the script or better, post the document your working on.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Generally it's done with an if then else statement:

if $(aktuellerMulti)>=$(j) then

     set rundungs = $(rundungs)#$(rundung);

end if

If that doesn't work you'll have to explain what you're trying to do and how, i.e post the script or better, post the document your working on.


talk is cheap, supply exceeds demand
richters
Partner - Contributor III
Partner - Contributor III
Author

Works great, but why the hell is there the when-condition available? I really dont get it.

swuehl
MVP
MVP

This works for me:

Let a = 1;

When a=1 Set B = 2;


So maybe just try:


when aktuellerMulti >= j set rundungs = $(rundungs)#$(rundung);