Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a simple table with 3 columns:
Date 1 containing dates
Date 2 containing different dates
ChosenDate containing either the value Date1 or Date 2.
For each record I would like to see a field called NewDate which is either Date1 or Date2 depending on the value in ChosenDate. Currently I tried $(ChosenDate) as NewDate but no luck. Any suggestions?
I think this will work:
Data:
LOAD *, RecNo() as Key INLINE [
ChosenDate, Date1, Date2, Date3
Date1, 100, 200, 300
Date2, 101, 201, 301
Date3, 103, 203, 303
Date2, 104, 204, 304
]
;
Choose:
LOAD
Key,
peek(peek('ChosenDate', RecNo()-1, 'Data'), RecNo()-1, 'Data') as NewDate
Resident Data
;
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
Thanks. Unfortunately I don't have RecNo in my table, which is a complex join of other tables.
RecNo() is not a field, it's a counter function. You have it.
-Rob