Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi i wanna take in my text box a field of my table with name according with the selected year. I try to explain, i have these 3 fields:
FIELD1_2017
FIELD1_2018
FIELD1_2019
When i select my year filed (for example 2018), i want in my text box i see : Sum(FIELD1_2019)
i know i can do that with some IF statement, but is possible in qlikview call a field composing it runtime with
name=FIELD1_ + selected year ? like Sum(FIELD1_[SELECTED_YEAR])
In general the logic suggested from Eliran will work and probably there is just an issue with syntax. Personally I would probably use something like this:
sum($(='FIELD1_' & max(Year)))
to get also a working expression if more as one year is selected respectively possible.
Beside this it might be much easier if you transformed your crosstable into a "normal" table-structure per The Crosstable Load.
- Marcus
Dear Daniele,
You can accomplish this with a variable easily:
vField==FIELD1_'&GetFieldSelections(Year)
sum($(vField)) inside the chart/text box.
BR,
Eliran.
Ok thanks, but it show me 0, if i show only the variable it show me correctly the name
Can you share some sample data and your expected output here?
In general the logic suggested from Eliran will work and probably there is just an issue with syntax. Personally I would probably use something like this:
sum($(='FIELD1_' & max(Year)))
to get also a working expression if more as one year is selected respectively possible.
Beside this it might be much easier if you transformed your crosstable into a "normal" table-structure per The Crosstable Load.
- Marcus
Thanks, this is better becouse i can use it not only in variable, i didn't want create a lot of variable, in this way i can use it directly in my text script.
Thanks