Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have extracted data from SAP, tables BSIK and BSAK and i would like to age the documents into buckets based on the document date. Buckets that I require are 0-5 days, 6-15 days, 16-30 days, 31-60 days, etc etc
In SQL i would use today-posting date (as an example)...how do I do this in Qlikview?
Basically the same way:
Load *,
if(Age<6, '0-5 days', if(Age<16,'5-15 days', if(Age<31,'16-30 days', if.... etc )))) as Bucket;
Load
DocumentID,
PostingDate,
PostingDate - Today() as Age
From ...somewhere...;
Note, if PostingDate isn't a numeric date field but a string you'll have to use the date# function to cast it to a date.
Basically the same way:
Load *,
if(Age<6, '0-5 days', if(Age<16,'5-15 days', if(Age<31,'16-30 days', if.... etc )))) as Bucket;
Load
DocumentID,
PostingDate,
PostingDate - Today() as Age
From ...somewhere...;
Note, if PostingDate isn't a numeric date field but a string you'll have to use the date# function to cast it to a date.
That is perfect - so glad I was on the right track!