Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi to all,
Could you help me with this?
sum(aggr(Cost_Transport, FCT_ExternalSalesCost_KEY))
it returns the cost as it should but i need previous year cost
so I tried use this:
sum( {<Year{'2018'}>} aggr(Cost_Transport, FCT_ExternalSalesCost_KEY))
but it doesn't work the value is 0
I have tried some solutions from forum but nothing works.
you already have the FCT_ExternalSalesCost_KEY field that's uniqu, so
if I select 2020 (Max year) : total of Cost_Transport from 2019 grouped by FCT_ExternalSalesCost_KEY when we select Year 2020
sum({<Year={"> $(=Max(Year)-1)"}>} aggr(Max({<Year={"> $(=Max(Year)-1)"}>} Cost_Transport),FCT_ExternalSalesCost_KEY))
Current selected Year -> Maxyear
sum({<Year={"$(=Max(Year))"}>} aggr(Max({<Year={"$(=Max(Year))"}>} Cost_Transport),FCT_ExternalSalesCost_KEY))
Year-1 : If I selected 2020 return 2019 value :
sum({<Year={"$(=Max(Year)-1)"}>} aggr(Max({<Year={"$(=Max(Year)-1)"}>} Cost_Transport),FCT_ExternalSalesCost_KEY))
and so on.
output :
attached qvw file
Thank you for sating with me and helping find the right solution.
It works as I need it.
Well.. so many years in QV and still learning 😉
we're all learners 😉