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: 
Not applicable

how to set a new variable or field which can be used afterwards

hi i have problems in setting a new variable or field

i have a column called runningPnL and i want a new column which is 2*runningPnL

I have tried:

1.png

2.png

3.png

but the variable is still not set:

4.png

so how can i set a variable??

please help me and thx in advance!

2 Replies
mightyqlikers
Creator III
Creator III

hi,

do that in the script level

like

load

          *,

              runningPnL*2 as New_runningPnL

from table;


$@M.

ciaran_mcgowan
Partner - Creator III
Partner - Creator III

Hi Kit, here are your options.

Create field in the script:

     runningPnL * 2 AS NewField

Create as a Variable in Variable Overview tool:

  1. Create variable called vPnL
  2. For the Definition, use runningPnL * 2
  3. When calling the variable, make sure to use $(), so instead of calling vPnL, you are calling $(vPnL)

Create as a Variable in the Script:

LET vPnL = '=runningPnL * 2';

Can be referenced in the QVW without using $().