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: 
denny_wu
Contributor
Contributor

Qlik Sense Dynamic field name for calculation

Hi,

i got problem with my data reloading script.

this is my data.

data.png

i want to add new field, that field is (RCCPStartYear + 2) - (RCCPStartYear + 1).

my script right now is like

Load

*,

    [(RCCPStartYear + 2)] - [(RCCPStartYear - 1)] AS Result

Resident OppositeTableGrowingPackFormat;

adds on value (2, 1) is dynamic using qlik variable.

the result should be like:

data.png

please help me...

thanks

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

I dont understand what you are trying to do. The expression

(RCCPStartYear + 2) - (RCCPStartYear + 1)

will always evaluate to 1, and I don't know what you mean by this line

[(RCCPStartYear + 2)] - [(RCCPStartYear - 1)] AS Result|

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
denny_wu
Contributor
Contributor
Author

i want do calculation base on RCCPStartYear.
if you see my field name have 2018, 2019, 2020.

so, i want calculate

RCCPStartYear (2018) + 2 = 2020

RCCPStartYear (2018) + 1 = 2019


and get value from field 2020 (1.44914) - 2019 (2.49384) = -1.0447