Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

denny_wu
New 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
MVP
MVP

Re: Qlik Sense Dynamic field name for calculation

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

Re: Qlik Sense Dynamic field name for calculation

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

Community Browser