Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
MadiF
Contributor III
Contributor III

Std Deviation of Complex Calculation

Hi everyone; I'm trying to produce the standard deviation of the result of a calculation. A very basic mock up of the calc is: 

(((Sum({<[D/U?]={'U'}>}Time) / count({<[D/U?]={'D'}>}[EventID])) / count(distinct ItemID))

 

/

 

(((Sum({<[D/U]={'U'}>}Time) / count({<[D/U]={'D'}>}[EventID])) / count(distinct ItemID)) + ((Sum({<[D/U?]={'D'}>}Time) / count({<[D/U?]={'D'}>}[EventID])) / count(distinct ItemID))))

 

Put more simply, (mean time between events) divided by (mean time between events + mean duration of events).

 

I tried wrapping this entire calc in stdev(aggr( calc, x)) but I'm getting lots of nulls depending on which dimension are in the chart, which aggregation level/aggr parameter I use, etc. I noticed in the documentation for the stddev function that you shouldn't use the function on aggregations unless those contain the 'TOTAL' qualifier, but I don't want to use TOTAL. I need the result to update depending on which level my end user is at in the pivot table. Is there a better way for me to measure std dev of the result of my calculation? I can't calculate the metric in the script either, as again I need the level to change based on dimensions in a pivot table.

 

Labels (1)
0 Replies