Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
TomBond77
Specialist
Specialist

Last value in a month

Hi experts

For a product we need the last "stock" value in a month. As you can see in this sample the last value in March 2022 is zero on 22.03.2022. This value is needed in the result without day in the drill down. Any ideas?

 

TomBond77_0-1654006698800.png

 

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Use Year and Month as dimensions, and the following measure:

FirstSortedValue(Value, -1*Date)

If there is more than one "Value" within a date, you may need to make a nested aggregation:

FirstSortedValue(Aggr(Sum(Value),Date), -1*Date)

 

View solution in original post

1 Reply
hic
Former Employee
Former Employee

Use Year and Month as dimensions, and the following measure:

FirstSortedValue(Value, -1*Date)

If there is more than one "Value" within a date, you may need to make a nested aggregation:

FirstSortedValue(Aggr(Sum(Value),Date), -1*Date)