Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to get a sub-total into a field in table but when I use Aggr I'm only getting one response back, subsequent rows are returning nulls.
Example data is
User | Type | Value |
1 | A | 2 |
1 | A | 3 |
1 | B | 5 |
1 | B | 4 |
1 | B | 1 |
2 | A | 15 |
2 | A | 4 |
2 | A | 9 |
2 | B | 1 |
2 | B | 4 |
My expectation is that
=Aggr(Sum(Value),User)
should return what I want but what I get is the below (the Required field is what I'm hoping to get).
User | Type | Sum(Value) | Required | Aggr(Sum(Value),User) |
1 | A | 5 | 15 | - |
1 | A | 10 | 15 | 15 |
2 | B | 25 | 30 | - |
2 | B | 5 | 30 | 30 |
Weirdly if I make the final column a Measure rather than a Dimension I get the first value rather than the second. What I need is to get the same result against all the rows with the same user.
The aim is to then use =Sum(Value)/Aggr(Sum(Value),User) to get the percentage of each type for each user.
To repeat aggr results, use nodistinct: =Aggr(NODISTINCT Sum(Value),User).
If User & Type are your dimensions in the object and the percent can be a measure (you mentioned something about it being a dimension?) I would do Sum(Total <User> Value).
To repeat aggr results, use nodistinct: =Aggr(NODISTINCT Sum(Value),User).
If User & Type are your dimensions in the object and the percent can be a measure (you mentioned something about it being a dimension?) I would do Sum(Total <User> Value).
Thanks Steve. NODISTINCT works perfectly.
I tried my original version as both a dimension and a measure out of desperation and all it did was move the result from the first to last record.