Qlik Community

QlikView Connectors

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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?

Tags (2)
1 Solution

Accepted Solutions

Re: Document Aging?

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
2 Replies

Re: Document Aging?

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

Re: Document Aging?

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

Community Browser