Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Document Aging?

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?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

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.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

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.


talk is cheap, supply exceeds demand
Not applicable
Author

That is perfect - so glad I was on the right track!