Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

richters
New 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
MVP & Luminary
MVP & Luminary

Re: When condition in script for set variable

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
3 Replies
MVP & Luminary
MVP & Luminary

Re: When condition in script for set variable

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
New Contributor III

Re: When condition in script for set variable

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

MVP
MVP

Re: When condition in script for set variable

This works for me:

Let a = 1;

When a=1 Set B = 2;


So maybe just try:


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

Community Browser