Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi;
I'm trying to create a calculation dimension based on a condition. My formula isn't working:
=aggr(if(sum({<[In Violation] = {'1'}>}[Units In Violation],1,0), [Location Type]))
I'm trying to calculation the number of units in violation for each location type. Any help will be appreciated. Thanks.
Is it possible to share a small sample..
How do you want your dimension to look like?
Not sure.. but seems to be condition is missing with if ..
Try like
=aggr(if(sum({<[In Violation] = {'1'}>}[Units In Violation])>0,1,0), [Location Type])
You want to calculate the number of units in violation, then you should be adding an expression, not a calculated dimension.
Use this Expression:
SUM({<[In Violation] = {'1'}>}[Units In Violation])
Or this Dimension
AGGR(SUM({<[In Violation] = {'1'}>}[Units In Violation]),[Location Type])
Thanks;
This was very helpful.
Thanks Vineeth Pujari;
This formula worked.
Also can you help me with another formula? I'm trying to get the total sum in the calculated dimension. See table below:
Days Complete Count VIN
< 5 3
5 - 10 5
> 10 1
Total 9
I used the following expression and getting invalid dimension:
aggr(if([Days Complete] < 5 count([VINS]),
if([Days Complete] >= 5 and [Days Complete] <= 10 count([VINS]),
if([Days Complete] > 10 Count([VINS]))))),[Location])
Thanks,
can you post sample data to demonstrate?
Your expression and dimension should be something as below
Dimension:
if([Days Complete] <5,'<5',
if([Days Complete] >= 5 and [Days Complete] <= 10,'5-10',
if([Days Complete] >10 ,'>10')))
Expression
SUM(VINS])
If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post) and Helpful Answers (found under the Actions menu under every post).
If not, please make clear what part of this topic you still need help with .