Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to add total of a column in straight table as sum and also average?
I have 4 dimensions and 3 expressions in straight table.
Dimension1: city
Dimension2: Age
Dimension3: Value1
Dimension4: Value2
expression1: $(variable1)*dim3
expression2: $(variable1)*dim4
expression1: ($(variable1)*dim3 + $(variable1)*dim4)/2
and Age range : (1-5 , 6-10 , 10-15 , 16 - 20)
I need tatal of expression :
if age range just was selected "1-5" Then Total = sum of expression1
but
if age range was selected more than 1 range ("1-5 "and "6-10") Then Total = (Sum(expression1) group by age + Sum(expression1) group by age) / 2
Did you attempt any?
Hi Loveisfail
Yes, I tried
I'm not sure which expression I have to use
Thanks
Try this - This is just an idea because we don't have any data. If you supply any file to work we can better than simple.
If(Age='1-5', Sum(Aggr($(variable1)*dim3, Age)),
If(Match(Age, '1-5', '6-10'), (Sum(Aggr($(variable1)*dim3, Age))+Sum(Aggr(($(variable1)*dim3 + $(variable1)*dim4), Age))/2))
Or
If(Age='1-5', Sum(Aggr($(variable1)*dim3, Age)),
If(Match(Age, '1-5', '6-10'), (Sum(Aggr($(variable1)*dim3, Age))+Sum(Aggr(($(variable1)*dim3 + $(variable1)*dim4), Age))/Count(Age))) // If You want 2 as Dynamic based on Age selection.