Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Can anybody help me please as I can't spot where I am going wrong with my expression and I've only been looking at it for over a day now!
I want to be able to calculate the agregated sum for the selectd weeks data but from the Previous year. I did think this was easy but the results I am getting back are the same for this year.
for this years data i am using the expression
Sum({$<year={$(=Only(Year))}, Week={$(=Only(Week))}>} SalesGross)
and for the previous years expression i am using:
Sum({$<year={$(=(Only(Year)-1))}, Week={$(=Only(Week))}>} SalesGross)
from my example I have attached, you will see that the lables and text box are retuning the right values so can't figure out what is wrong with my expression
Many thanks
Lawrence
Hi,
please look for upper and lower case writings. As I see from your data model, the field "Year" exists, but not the field "year"
Use:
Sum({$<Year={$(=(Only(Year)-1))}, Week={$(=Only(Week))}>} SalesGross)
If you select this row in your model you will see the message "bad field "year". Correct it and you will see a difference!
Good luck!
instead of
Sum({$<year={$(=(Only(Year)-1))}, Week={$(=Only(Week))}>} SalesGross)
Hi,
please look for upper and lower case writings. As I see from your data model, the field "Year" exists, but not the field "year"
Use:
Sum({$<Year={$(=(Only(Year)-1))}, Week={$(=Only(Week))}>} SalesGross)
If you select this row in your model you will see the message "bad field "year". Correct it and you will see a difference!
Good luck!
instead of
Sum({$<year={$(=(Only(Year)-1))}, Week={$(=Only(Week))}>} SalesGross)
Thanks very much for your help, but i now feel such a complete idiot.
Kind regards
Lawrence