Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi i have a field with all 365 days were days are marked either 01,03 or 04.
There are 3 fields stream(5), year(2020) and note(03030101040101010101...........)
I want to split and date note like
2020-01-01 03
2020-01-02 03
2020-01-03 01
is it possible? se sampledata.qvw
@djnqlear not sure if I completely understand . But gave it a shot
Data:
LOAD Year,
Stream
date(makedate(Year)+IterNo()-1) as Date,
mid(Note, IterNo()*2-1,2) as Note,
Note as Note_Original
FROM Table
while IterNo() <= (len(Note)/2);
@djnqlear what is logic to get date from long Note field value?
I'm thinking that you could do something similar to this.
For i =0 to 264
Load
stream,
year,
dayname(yearstart(makedate(year)) + $(i)) as Date,
mid(note, $(i) *2+1) as note
From source;
Next i
first 2 char in note field is 2020-01-01 next 2 2020-01-02 ....
For example, if your data was in a Resident table "Data" (adjust to where ever your input is).
LOAD
Stream,
Year,
Date(MakeDate(Year) + IterNo()) as Date,
Mid(Note, IterNo() * 2 - 1, 2) as NoteValue
Resident Data
While IterNo() * 2 < len(Note)
;
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
Dates missing 2019-01-01?
@djnqlear not sure if I completely understand . But gave it a shot
Data:
LOAD Year,
Stream
date(makedate(Year)+IterNo()-1) as Date,
mid(Note, IterNo()*2-1,2) as Note,
Note as Note_Original
FROM Table
while IterNo() <= (len(Note)/2);