Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting the first and last values of a selection

Hi. I have a date field and an inventory field in my file and I would like to add the last and first inventory of the selected date range and divide it by 2 to get the average inventory. I've tried to do this with sets but with no luck at all. Any ideas?

Thanks

3 Replies
Miguel_Angel_Baeyens

Hi,

Try

Avg({< Date = {'$(=Max(Date))', '$(=Min(Date))'} >} Inventory)


Hope that helps

johnw
Champion III
Champion III

One inventory value per date? Maybe this?

avg({<Date={'$(=max(Date))','$(=min(Date))'}>} Inventory)

Edit: Doh! Beaten to it. Smile

Not applicable
Author

Oh sorry my Bad, not actually there are more fields like articlenumber 🙂 I need the average inventory for all selected articles during a selected period.