Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Consider the following data:
LOAD * INLINE [
X, Y
1, 10
2, 20
3, 30
4, 40
5, 50
];
The sum, avg, and stdev are as follows: 150, 30, & 15.8
I'd like a table that shows X, Y, sum, avg, stdev, X+Y, X+sum, and Y+stdev. It should look like this:
I set X as a dimension
I set Y as a measure (I picked sum. Does it matter?)
=sum(Y)
=avg(Y)
=stdev(Y)
=X+Y
=X+sum(Y)
=Y+stdev(Y)
What I want:
1 10 150 30 15.8 11 25.8
2 20 150 30 15.8 22 35.8
3 30 150 30 15.8 33 45.8
etc.
Instead, this is what I get:
1 10 10 10 - 11 11 -
2 20 20 20 - 22 22 -
3 30 30 30 - 33 33 -
etc.
Thanks!
Hi,
Where you have an aggregation across all of the Y values you need to use TOTAL, so your =sum(Y) should be =sum(TOTAL Y) etc.
Cheers,
Chris.
Hi,
Where you have an aggregation across all of the Y values you need to use TOTAL, so your =sum(Y) should be =sum(TOTAL Y) etc.
Cheers,
Chris.
Thanks!
Would you have any insight on how aggr might be appropriate? That's another commonly used function that I'm trying to understand.
Specifically I'm looking at this function that creates a reference line in a chart:
=avg(Y) + Stdev(total aggr(avg(Y),X))
EDIT:
This gives me exactly the same table as =Y + stdev(total Y) except that the above equation gives me some sort of average.
I'm still tinkering with it........
EDIT #2:
Okay, putting avg in fromt of Y give me the exact same equations. So I'm not sure what aggr is accomplishing.
=Avg(Y) + stdev(total Y)
=Avg(Y) + stdev(total aggr(avg(Y),X))