I've a calculated dimension 'FinalSegment' and I need to create a Cost measure which uses aggregation on FinalSegment. I tried the following and it didn't work.
I've created variable vFinalSegment : if(len(trim(Segment))=0,Segment_2,Segment)
sum(aggr(Cost, ID,Buyer,$(vFinalSegment) ))
But, this measure returns 0.
May I know how to do this?
try like this
create calculated dimension
if still not working, try to share mock data with expected output in excel format
Can you replace it to first place
Are you evaluating your variable rowwise or chartwise? For chart wise, may be try one of the two:
Sum(Aggr(Cost, ID, Buyer, $(=vFinalSegment)))
Sum(Aggr(Cost, ID, Buyer, $(=$(vFinalSegment))))
or if this is row wise, may be this
Sum(Aggr(Cost, ID, Buyer, Segment_2, Segment))
I'm, doing it chart wise; I've tried the expressions you've suggested but they are returning 0
Any clue what could be going wrong?
I appreciate your help. Thanks!