Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I'm trying to create a table with some years starting from a label field.
I have the label PRICE_2013 and with the instruction:
Right (@37,4) as starting_Year
I can get 2013 tha is the starting year of my study. Now I'd like to put this starting_Year into a variable ($vyear) in order to make a loop and icrease automatically the value of the year like this:
//first year
LOAD
$(vyear) as Year,
...
////Second year
//LOAD
//($(vyear)+'1') as Year,
.....
....
I tried to set as variable with GetFieldSelections() but It doesn't work because It doesn't recognize the filed starting_Year, maybe because It don't see 2013 as an integer but as a string i don't know!
Maybe somebody can help!
Hi Ylenia - are you using Sense or QlikView?
Mike
Qlickview
Hi Ylenia
I've moved this question over to the QlikView part of the community.
All the best
-Mattias
Hi!
Something like this:
tmp:
Load * Inline [
Year
2014
];
Years:
NoConcatenate
Load * Inline [
Year
];
for i = 0 to 12
Concatenate (Years)
Load
Year + $(i) as Year
Resident tmp;
next;
DROP Table tmp;
Br,
Miikka
Climber Finland
I think the fieldname function would help you. The getfieldselections is only used in the UI when a user is making selections.
let vyear = right( fieldName( x, 'TableName'),4)
Hi Miikka,
the table has to be dynamic, I don't wanna insert the year with the INLINE function because the data of the next year will start with the price of 2015.
I just want to read it from the label an put it in a variable.
Why dont you try peek??
let vyear = peek('starting_Year');
Thanks a lot Patrick It works perfectly as I wanted!
youre welcome