Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vmoreno2605
Creator
Creator

Use variables as arithmetic operators

Hi everyone!

I have an excel that is gonna be modified by a user, in this file we will have a column with the following operators (i dunno their names in english, sorry) "<=, <, >=, >, =".

I need to use them in my script like this:

Load ID, Date,
if(Date-Date>=3,1,0) as Field
Resident Table;

 

Using a variable instead of ">="

 

Thank you.

1 Solution

Accepted Solutions
JordyWegman
Partner - Master
Partner - Master

Hi Vmoreno,

You can load these math symbols in Qlik and put them in a variable, small example:

MathSymbols:
Load
  Symbol
From [MathSymbols] (qvd);

Load vMathSymbol = Peek('Symbol,0,'MathSymbols');

FinalTable:
Load
  ID,
  Date,
  IF(Date-Date $(vMathSymbol) 3, 1, 0) as Field
Resident Table;

Drop table Table;

Jordy

Climber

Work smarter, not harder

View solution in original post

1 Reply
JordyWegman
Partner - Master
Partner - Master

Hi Vmoreno,

You can load these math symbols in Qlik and put them in a variable, small example:

MathSymbols:
Load
  Symbol
From [MathSymbols] (qvd);

Load vMathSymbol = Peek('Symbol,0,'MathSymbols');

FinalTable:
Load
  ID,
  Date,
  IF(Date-Date $(vMathSymbol) 3, 1, 0) as Field
Resident Table;

Drop table Table;

Jordy

Climber

Work smarter, not harder