Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
First, i know there has been many posts and questions regarding this issue, but i haven't found a solution
i am trying to make a YTD/LYTD calculations, that will count the number of opened projects in 2018 vs 2019
iv'e defined a master calendar and it is working well and in it i defined :
If( TempDate - YearStart(TempDate) <= Today() - YearStart(Today()), 1, 0 ) as IsInYTD
so far so good, now i tried doing a bar chart to compare 2019-2018 by month
so i defined the variables in the UI variables (Based on my calendar)
vMaxDate - Max(KickOffDate)
vMaxYear - Max(KickOffYear)
vPriorYear - Max(KickOffYear)-1
and than i tried to do the set expression that will count the number of projects in that time period,
when i do the set expression using {'2019'} and {'2018'} it works, but when i use variables it makes the sum of 2018+2019
*CountProjects is defined in the project table '1 as CountProjects'
Count( {$<IsInYTD={1},KickOffYear={'2019'}>} CountProjects )
Count( {$<IsInYTD={1},KickOffYear={'2018'}>} CountProjects )
when i try to change it to the variable using this set:
Count( {$<IsInYTD={1},KickOffYear={'=$(vMaxYear)'}>} CountProjects ) - 2019
Count( {$<IsInYTD={1},KickOffYear={'=$(vPriorYear)'}>} CountProjects ) - 2018
i get the same value for both:
iv'e tried looking for this in older posts but no matter how i tried i didn't get the right calculation if any.
any ideas?
Thanks!
wow,
thank you very much for a very good and explained solution!!
this was very helpful both to my model and my knowledge. 🙂
Hi @gmenoutis ,
That' great knowledge sharing.
Can u pls put some light on my revert, why it is not working in @roisolberg 's case?
-Shubham