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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
PurplePills555
Contributor III
Contributor III

Standard Deviation with Set Analysis

So I have a table with order ids and order types and dates. Im trying to work out the standard deviation of the number of orders for each month from Aug 18 until July 19 (So I can compare my last completed month Aug to it, confidence intervals etc). I am using count distinct of Order ID as there is multple rows in the main data table. 

So e.g

Jan Unique Orders -10

Feb Unique Orders-15

etc etc

and then find the S.D of these 12 months

I tried this expression and I just get blank because it is unable to calculate. Variables I am using are correct, as using elsewhere.

=StDev(Aggr(((Count({<[Order Type] = {"Food", "Drink"},[COMPLETED_ON.fiscalCalendar.Date] = {">=$(=vFirstDatePrev13Month) <=$(=vLastDatePrev2Month)"}>}, Distinct [Order ID][COMPLETED_ON.fiscalCalendar.Date])

Any ideas?

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

Try this

=StDev(Aggr(

  Count({<[Order Type] = {"Food", "Drink"}, [COMPLETED_ON.fiscalCalendar.Date] = {">=$(=vFirstDatePrev13Month)<=$(=vLastDatePrev2Month)"}>} DISTINCT [Order ID])

, [COMPLETED_ON.fiscalCalendar.Date]))

View solution in original post

4 Replies
sunny_talwar

Try this

=StDev(Aggr(

  Count({<[Order Type] = {"Food", "Drink"}, [COMPLETED_ON.fiscalCalendar.Date] = {">=$(=vFirstDatePrev13Month)<=$(=vLastDatePrev2Month)"}>} DISTINCT [Order ID])

, [COMPLETED_ON.fiscalCalendar.Date]))
PurplePills555
Contributor III
Contributor III
Author

Awesome thanks for the help!

leonardocapriglione
Contributor II
Contributor II

<P>Hey, Can you help me with some doubt?</P><P>I'd to make a standard deviation in a range date,</P><P>I use this :</P><P><STRONG>=avg(aggr(SUM({&lt;decision={'AP'}&gt;}amount)/Sum(amount),date))</STRONG></P><P>but in my graphic this formula gets the standard deviation variable, I would like to have the standard deviation in the fixed date in graph. Thanks,</P>\

sunny_talwar

Not sure I understand... would you be able to share a sample?