Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
i want to compare sales for current and previous year but i am getting same values for all. pease help
so for that i have declared
current year
curr_year = Max(sold_Year)
previous year
prev_year=max(sold_year)-1
for expression for current year
=num(sum({<sold_year = {"$(curr_year)"}>}[inv value])/(Sales_INR_Unit),'#,##0.0')
for expression for previous_year
=num(sum({< sold_Year = {"$(=$(prev_year))"}>}
[inv value]/Sales_INR_Unit),'#,##0.0')
for total growth
=num(
sum({<sold_year = {"$(curr_year)"}>}[inv value])
-
sum({< sold_Year = {"$(=$(prev_year))"}>}
[inv value])
/
sum({< sold_Year = {"$(=$(prev_year))"}>}
[inv value]/Sales_INR_Unit),'#,##0%')
Ok then try this direct use the Max(sold_Year) on the set expression.
Current Year
=num(sum({<sold_year = {'$(=Max(sold_Year))'}>} [inv value])/(Sales_INR_Unit),'#,##0.0')
Previous Year
=num(sum({< sold_Year = {"$(=Max(sold_Year)-1)"}>} [inv value]/Sales_INR_Unit),'#,##0.0')
can you check this in Text box?
=Num(Sum({< sold_Year = {'$(=Max(sold_year)-1)'}>} [inv value]/Sales_INR_Unit),'#,##0.0')
i have taken in text box (circlen in black color) its giving the same value as in charts total
Good, Is that value is the same for Current Year / Different? Remove Red part and try. Not sure, What your intend to write different for Curr and Prev. ??
=num(sum({<sold_year = {"$(curr_year)"}>}[inv value])/(Sales_INR_Unit),'#,##0.0')
=num(sum({< sold_Year = {"$(=$(prev_year))"}>} [inv value]/Sales_INR_Unit),'#,##0.0')
What output you get in
curr_year = Max(sold_Year)
prev_year=max(sold_year)-1
Individually check expression on the text object did you get anything on this objects if not means your year field is string which not give correct result so please check this.
Ok then try this direct use the Max(sold_Year) on the set expression.
Current Year
=num(sum({<sold_year = {'$(=Max(sold_Year))'}>} [inv value])/(Sales_INR_Unit),'#,##0.0')
Previous Year
=num(sum({< sold_Year = {"$(=Max(sold_Year)-1)"}>} [inv value]/Sales_INR_Unit),'#,##0.0')