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

Get last value of max date of each period ignoring date filter

Hello!

I need to find value of data of max date in each period ignoring global date filter.

I use

FirstSortedValue(
{1<Type={'warehouse_data'}, [Date.Calendar.Year], [Date.Calendar.Month], [Date.Calendar.Quartal], [Date]>}
aggr(sum(quantity*product_price),[Date]), -aggr(Date, Date))

 

But this doesn't work(

 

 

Labels (2)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

FirstSortedValue({<Type={'warehouse_data'}, [Date.Calendar.Year]=, [Date.Calendar.Month]=, [Date.Calendar.Quartal]=, [Date]=>}
aggr({<[Date.Calendar.Year]=, [Date.Calendar.Month]=, [Date.Calendar.Quartal]=, [Date]=>}

Sum({<{[Date.Calendar.Year]=, [Date.Calendar.Month]=, [Date.Calendar.Quartal]=, [Date]=>}quantity*product_price),[Date]),

-aggr({<[Date.Calendar.Year]=, [Date.Calendar.Month]=, [Date.Calendar.Quartal]=, [Date]=>} Max({<[Date.Calendar.Year]=, [Date.Calendar.Month]=, [Date.Calendar.Quartal]=, [Date]=>}Date), Date))

View solution in original post

2 Replies
BrunPierre
Partner - Master
Partner - Master

FirstSortedValue({<Type={'warehouse_data'}, [Date.Calendar.Year]=, [Date.Calendar.Month]=, [Date.Calendar.Quartal]=, [Date]=>}
aggr({<[Date.Calendar.Year]=, [Date.Calendar.Month]=, [Date.Calendar.Quartal]=, [Date]=>}

Sum({<{[Date.Calendar.Year]=, [Date.Calendar.Month]=, [Date.Calendar.Quartal]=, [Date]=>}quantity*product_price),[Date]),

-aggr({<[Date.Calendar.Year]=, [Date.Calendar.Month]=, [Date.Calendar.Quartal]=, [Date]=>} Max({<[Date.Calendar.Year]=, [Date.Calendar.Month]=, [Date.Calendar.Quartal]=, [Date]=>}Date), Date))

maryna_hubska
Contributor II
Contributor II
Author

Thank you! This really works!