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: 
aworrall
Luminary Alumni
Luminary Alumni

Adding a 'last used' date to a list of transactions

Hi

 

I'd like to add something into my script to find the last date an item of stock was used.  I would then use this date to calculate how old the stock was (based on the last time it was used).

Please see picture of example data, but basically it's Stock Code, Date of Transaction and quantity of the movement.  It is a standard stock ledger showing each and every stock transaction.

 

Many thanks

1 Reply
JordyWegman
Partner - Master
Partner - Master

Hi Aworral,

You can do something like this:

 

let vToday = floor(today())

Table
Load
     [Item Code],
     $(vToday) - Date as DaysAgo
;
Load
      [Item Code],
      Max(Floor(Date)) as Date
From Source
Group by [Item Code]
;

 

 

Work smarter, not harder