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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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 II
Partner - Master II

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 II
Partner - Master II

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!