Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey There,
i try to use function on set analysis but i see i have an errors in my expression.
need some help
This is not working
=Sum({<Left(OrderDateKey,4)={'2006'}>}SalesAmount)
This is work :
Sum({$<Year={"$(=Year(Today()))"}>}Sales)
But you can do a search on your field values like
=Sum( {<OrderDateKey={"2006*"} >} SalesAmount)
edit:
This should also work, just for demonstration:
=Sum( OrderDateKey={"=Left(OrderDateKey,4)=2006"}>}SalesAmount)
You are not allowed to use functions on the left hand side of the set analysis modifier and that is why the first expression isn't working.
You can only compare fields (in your case Year) with values within Set Analysis.
So if you convert OrderDateKey in your script into a Year field, you'll be able to create the second proposed Set Analysis.
And for performance reasons it is also better to prepare your dimensions in the script instead of having a calculated dimension in your front-end of the dashboard.
1st expression:
one solution could be to add a year field in the script (maybe in a calendar),
then use this new field in set analysis
But you can do a search on your field values like
=Sum( {<OrderDateKey={"2006*"} >} SalesAmount)
edit:
This should also work, just for demonstration:
=Sum( OrderDateKey={"=Left(OrderDateKey,4)=2006"}>}SalesAmount)
Thank you but the second expression not working for me. i think the best way to do it is on the script
I think about it as solution wanna be sure that is not possible Thx