Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Standard Deviation of Calculated field & aggregated?

Hi All

I have 2 dimensions F1 and F2.  F3 is my  total cost and F4 is the number of units.  So my unit cost is sum(F3)/sum(F4).

So here's my question, I need to show the unit cost standard deviation aggregated across the different F1 values.

I've created the attached to illustrate the problem and included a picture of my desired result (created in excel).

Many thanks

Dominic

1 Solution

Accepted Solutions
nagaiank
Specialist III
Specialist III

Add the following code.

(If the table name of your data table is Tab1)

Tab2:

load F1, stdev(F3/F4) as StDev resident Tab1 group by F1;

View solution in original post

5 Replies
nagaiank
Specialist III
Specialist III

Add the following code.

(If the table name of your data table is Tab1)

Tab2:

load F1, stdev(F3/F4) as StDev resident Tab1 group by F1;

Not applicable
Author

heres something I've used which may be of use. I used it to add a reference line for std dev to a bar chart

=avg(total aggr(sum([Days to Record]), [Field1])) +

($(vStdDev) * stdev(total aggr(sum([Days to Record]),[Field1])))

Charlotte

Not applicable
Author

Hi Krishmoorthy,

Your suggestion works for my example, except as it turns out it was a bad example - in my real app I was trying to replicate there are more fields that split F3 further, this means that your suggestion no longer works.  Sorry for bad example.

Thanks for any help!

Dominic

nagaiank
Specialist III
Specialist III

What are the requirements of your real application?

How is the field F3 split?

Whatever may be the details, if you can arrive at the cost, you can use that expression instead of F3.

Not applicable
Author

You're right, sorry it was my bad maths.  Your expression worked perfectly.  Thank you.