Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I have the following KPI:
=Sum({<Year={'$(vLastYear)'}>}TotalPriceBeforVat)
when I choose date by a date picker, for example oct 2019-
I would like to get the sum of TotalPriceBeforVat of 2018.
my Variable vLastYear is equal to :year(max(Date))-1
I get 0 instead of an sum of TotalPriceBeforVat when I select the date by a date picker but when I select another filter like month/year/week and so on I get the sales of the previous year as excepted,
I have TotalPriceBeforVat in my date for 2018 so this is not the issue..
the issue is that it doesn't sums up when I choose my time period from the date picker specific.
even when I change the set analysis to: Sum({<Year={'2018'}>}TotalPriceBeforVat)- it gives me 0 as the output.
why It doesn't sum the TotalPriceBeforVat when I choose the period from m date picker?
Before looking for any issues with the expression/variables take a look on the data - by using a table-box with Date + Year + TotalPriceBeforVat. Are there really the expected values?
Hi,
Yes ,I can see data for 2018 when I choose the date through the date picker in the table.
The Top Kpi is 0 as I wrote before..
but when I choose the date by other date filter ( not the date picker) it's working..
Make sure that the field from the date-picker is related to the other period-fields. Otherwise you may need to change this field.
It’s related since the variable lastyear is based on the date field and it gives the correct year..
If the variable really returned the shown result of 2,018 the expressions should fail. Try to adjust the result by adding: num(year(max(Date))-1, '0000')
Hi,
It's still the same:
the ne
w lastyear variable:
the KPI:
@hadari I can see that your variable returns 2,018, Do you have the expression how that is created?
In regard to your origin statement of:
" ... even when I change the set analysis to: Sum({<Year={'2018'}>}TotalPriceBeforVat)- it gives me 0 as the output ..."
start again by checking your data-set because if a hard-coded '2018' didn't work it means that your issue isn't mainly related to the variable.
Especially take a look if you have appropriate data for 2017 which would be related as previous values for 2018.