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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
rubenares
Partner - Contributor
Partner - Contributor

FirstSortedValue using Aggr

Hi all,

We have following dataset...

dataset.png

... and we need to show diferent measures when user select a date:

  • Select Date Qty: SOLVED with..
    • Sum([Qty])
  • Last Date: SOLVED with..
    • FirstSortedValue({<Date=>} Date, Aggr(Sum({<Date=>} Floor(Today())-Floor(Date)), Date, Name))
  • Last Date Qty: NOT SOLVED..
  • Max Qty Date: SOLVED, but with problems cause in the example the Qty is the same in all dates and we want in this case show last date among valid dates.
    • FirstSortedValue({<Date=>} Date, -Aggr(Sum({<Date=>} [Qty]), Date, Name))
  • Max Qty Date Qty: SOLVED, but with the previous problem.
    • FirstSortedValue({<Date=>} Aggr(Sum({<Date=>} [Qty]), Date, Name), -Aggr(Sum({<Date=>} [Qty]), Date, Name))

The result with previous measures is the following:

datafiltered.png

.. and data should be displayed are:

Select Date Qty: 0,6

Last Date: 31/3/2019

Last Date Qty: 0,6

Max Qty Date: 31/3/2019

Max Qty Date Qty: 0,6

 

Does anyone know to solve the problem with measures? Thanks in advanced!

 

Labels (2)
0 Replies