Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
Showing results for 
Search instead for 
Did you mean: 

STD Deviation from an AGGR function.

Hi All,

im trying to create a std deviation calculation to show how far away from the price a certain customer is. 

so i have this logic:

=min({<Customer>} total <Customer> Aggr({<Customer>}If(PricePaid = FirstSortedValue({<Customer>} TOTAL <Customer> PricePaid, -Aggr(Sum({<Customer>}[Quantity]), Customer, PricePaid)), only({<Customer>}PricePaid)), Customer, PricePaid))

which finds by each customer the most frequent price each customer has paid for a particular product, as shown below an example:

Screenshot 2020-01-02 at 12.38.28.png

what i want to do is then create ST deviation for these results that are created in using the logic above.


is this something that i can incorporate into a Stdev expression?


2 Replies
Digital Support
Digital Support

Maybe the following would work:



Best I have, hopefully that may be of some help, if not, hopefully someone else that is better at development will be able to suggest something.  You could try the Design Blog area too, but I did some searching, was not finding much related to stats though...



To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Specialist II
Specialist II

You just need to wrap your function in another aggregation and then calculate the standard deviation; please note you had some unnecessary set expressions in your formula which I've removed 

=Stdev(aggr(min(total <Customer> Aggr(If(PricePaid = FirstSortedValue( TOTAL <Customer> PricePaid, -Aggr(Sum([Quantity]), Customer, PricePaid)), only(PricePaid)), Customer, PricePaid)), Customer))