Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to do a KPI chart that compares YTD sales v PYTD sales but I am getting nil for PYTD no matter what I try. What I have at the moment is:
1) A variable - vTodayPriorYear = date(addyears(max(Today()),-1),'DD/MM/YYYY')
2) Expression - SUM({$< Year={'$(vPriorYear)'}, CalDate={'<=$(vTodayPriorYear)'} >} [Gross sales value])
If I remove the bold section of the expression above, I get all the sales for the prior year but once added, I get zero. In the edit expression window I am getting OK & SUM({$< Year={'2018'}, CalDate={'<=17/11/2018'} >} [Gross sales value]) so from that I know the variable is working.
How can I determine where this is falling over?
If you want to stick with your current approach... can you try this
vTodayPriorYear = Date(AddYears(Today(),-1), 'DD/MM/YYYY')
And then this (added an equal sign after $(...
Sum({$<Year = {'$(vPriorYear)'}, CalDate = {'<$(=vTodayPriorYear)'}>} [Gross sales value])
or this (added an =$( after $(
Sum({$<Year = {'$(vPriorYear)'}, CalDate = {'<$(=$(vTodayPriorYear))'}>} [Gross sales value])
Hi
Try this
YTD : Sum({$<CalDate={">=$(=Date(YearStart(Today()))))<=$(=Today())"}>}[Gross sales value])
PYTD : Sum({$<CalDate={">=$(=Date(AddYear(YearStart(Today())),-1))<=$(=Date(AddYears(Today(),-1)))"}>}[Gross sales value])
Hope this helps
Thanks
If you want to stick with your current approach... can you try this
vTodayPriorYear = Date(AddYears(Today(),-1), 'DD/MM/YYYY')
And then this (added an equal sign after $(...
Sum({$<Year = {'$(vPriorYear)'}, CalDate = {'<$(=vTodayPriorYear)'}>} [Gross sales value])
or this (added an =$( after $(
Sum({$<Year = {'$(vPriorYear)'}, CalDate = {'<$(=$(vTodayPriorYear))'}>} [Gross sales value])
Thanks for both the replies. As I am new and learning, seeing more than one approach helps.