Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to add the function below as a variable to my code instead of master measure but it keeps giving me errors. I tried breaking it up and using the variables but it's still not working. Can anyone help me?
sum(aggr(count({<Rprtd_Flag={'Y'}>} Distinct UniqueKey),[Service Date]))
thanks a lot..
It's probably not liking the single quotes in your set analysis {'Y'}. You need to break it up and use chr(39) instead.
= 'sum(aggr(count({<Rprtd_Flag={' &chr(39) &'Y' &chr(39) &'}>} Distinct UniqueKey),[Service Date]))'
I think you're missing some parenthesis or so ( assuming that Y is your variable)..
Try :
sum(aggr(count({<Rprtd_Flag={'$(Y)'}>} Distinct UniqueKey),[Service Date]))
or
sum(aggr(count({<Rprtd_Flag={'$(=Y)'}>} Distinct UniqueKey),[Service Date]))
What error do you get?
Unexpected Token....
see below
Oh, you are trying to store this expression into a variable within the script? May be try SET like this
SET Cnt_All_Unique = Sum(Aggr(Count({<Rprtd_Flag = {'Y'}>} DISTINCT UniqueKey), [Service Date]));
sorry maybe I didn't explain well but yes, that's the whole code for this part which is still creating the same error.
SET Cnt_All_Unique = Sum(Aggr(Count({<Rprtd_Flag = {'Y'}>} DISTINCT UniqueKey), [Service Date]));
let Cnt_All_Unique= $(Cnt_All_Unique);
It's probably not liking the single quotes in your set analysis {'Y'}. You need to break it up and use chr(39) instead.
= 'sum(aggr(count({<Rprtd_Flag={' &chr(39) &'Y' &chr(39) &'}>} Distinct UniqueKey),[Service Date]))'
That was it... thank you so much.
Really appreciate all your help both of you.