Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Finding values based on date

Hi,

I have a data in which there are several purchase orders (POs) with item numbers, quantity and expected receipt date.

Now i need to find out per item number first three expected receipt dates which should be greater than today i.e. should be in future. Besides that I also need to find out how much quantity will be received for that item number on these dates.

I have calculated the first three expected receipt dates in future per item but the quantity for these dates is giving me some headache.

I have attached herewith the excel file containing source data plus the Qlikview file in which I have calculated the first three dates.

I have used below formulas for calculating dates

1st date:

=min({<[Expected Receipt date]= {'>=$(=today())'}>} date(([Expected Receipt date])))

2nd date:

=min({<[Expected Receipt date]= {'>=$(=today())'}>} date(([Expected Receipt date])),2)

3rd date:

=min({<[Expected Receipt date]= {'>=$(=today())'}>} date(([Expected Receipt date])),3)

The formula which I am using to calculate quanity for above dates is as below:

Quantity for 1st date:

=sum(Aggr(if([Expected Receipt date]= min({<[Expected Receipt date]= {'>=$(=today())'}>} (([Expected Receipt date]))),[Quantity]),%Key))

I expect below outcome:

       

Item NumberDate 1Quantity 1Date 2Quantity 2Date 3Quantity 3
C002-C01-08-WLM-WLM-09A02/10/20172002/11/20173502/12/201745
C002-C02-08-WLM-WLM-09A08/10/20172208/11/20172508/12/201735
C002-C03-08-WLM-WLM-09A02/11/20172502/12/20173610/12/201763
C002-C04-08-WLM-WLM-09A09/11/20172009/12/20172418/12/201742

Request you to help me with the calculation.

Thank you for your all support,

Ashish Malkar

1 Solution

Accepted Solutions
Kushal_Chawda

try below expression for Quantity 1

=sum(aggr(if([Expected Receipt date]=min(total <[Item Number]>{<[Expected Receipt date]= {'>=$(=today())'}>} (([Expected Receipt date]))),[Quantity]),[Expected Receipt date],[Item Number],[Line No.]))

like wise you can create the same expression for Quantity 2,3 4

View solution in original post

4 Replies
Kushal_Chawda

try below expression for Quantity 1

=sum(aggr(if([Expected Receipt date]=min(total <[Item Number]>{<[Expected Receipt date]= {'>=$(=today())'}>} (([Expected Receipt date]))),[Quantity]),[Expected Receipt date],[Item Number],[Line No.]))

like wise you can create the same expression for Quantity 2,3 4

Kushal_Chawda

is this the same thread?

Finding Values based on date

Not applicable
Author

Thank you very much Kushal for the calculation. It is working as required.

Kind regards,

Ashish Malkar

Not applicable
Author

Yes, its same thread posted by my colleague.