Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load where and if

Hi all,

I want to restrict my load with a variable.

Example:

Test:

Load

*

resident Pretest

where Zahl < 5000   // here I want to use a variable that where is olny active if variable = 1

Thank you for helping

Robert

1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

try this

1. don't set the variable in the script to an empy value (let Myvar = '';)

2. use right notation in Where Clause:

WHERE (Field1 = $(Myvar));  // on numeric value

WHERE (Field1 = '$(Myvar)');  // on string value

or simply

WHERE '$(vtest)'=1;

View solution in original post

9 Replies
tresesco
MVP
MVP

Try like :

where $(variableName) = 1;


you may use it in combination as well like:

where Zahl < 5000 and  $(variableName) = 1;

Chanty4u
MVP
MVP

try this

1. don't set the variable in the script to an empy value (let Myvar = '';)

2. use right notation in Where Clause:

WHERE (Field1 = $(Myvar));  // on numeric value

WHERE (Field1 = '$(Myvar)');  // on string value

or simply

WHERE '$(vtest)'=1;

Kushal_Chawda

if variable =1 then

Let vCondition ='where Zahl < 5000';

else

Let vCondition ='';

Endif


Test:

Load

*

resident Pretest

$(vCondition);

Anonymous
Not applicable
Author

Thank you.

It works if $(variableName) = 1


but if $(variableName) = 0 there is no load => I want to load everything if $(variableName) = 0


tresesco
MVP
MVP

In that case, I guess the example kush141087‌ explained below should work. Try that.

Anonymous
Not applicable
Author

Thank you very much => sureshqv

Chanty4u
MVP
MVP

Thanks  it works for you

parthesh
Creator
Creator

Hello,

Please try below.

Example:

Test:

Load

*

resident Pretest

where If($(vLoadValue)=1, Zahl < 5000) ;

Anonymous
Not applicable
Author

Hi parthesh raval,

doesn't work for $(vLoadValue)=0