Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rakeshkumar1890
Creator
Creator

Standard Deviation

Hi,

I am struggling to find out Standard deviation, here my expression is

stdev(aggr(sum({<Inc_CalendarDate={'>=$(=date(vCal12MonthBack))<=$(=date(vTodate))'}>}

[Invoiced Quantity]),Inc_Country))

Labels (1)
4 Replies
Sebastian_Fredenberg

Hi,

The Qlik Scalability place is mainly for performance related questions (testing and tools). Your question seems to be better suited in the general Sense forum:

Qlik Sense Forums

Cheers

sunny_talwar

Is this in a chart? May be you need to use TOTAL Qualifier if it is in a chart


Stdev(TOTAL Aggr(Sum({<Inc_CalendarDate = {'>=$(=date(vCal12MonthBack))<=$(=date(vTodate))'}>} [Invoiced Quantity]), Inc_Country))

And it might make sense to add your set analysis in the outer aggregation also

Stdev(TOTAL {<Inc_CalendarDate = {'>=$(=date(vCal12MonthBack))<=$(=date(vTodate))'}>} Aggr(Sum({<Inc_CalendarDate = {'>=$(=date(vCal12MonthBack))<=$(=date(vTodate))'}>} [Invoiced Quantity]), Inc_Country))

rakeshkumar1890
Creator
Creator
Author

It returns 0 value but I have solve the problem by another way

Stdev( if (

Inc_CalendarDate >= date(vCal11MonthDate) and Inc_CalendarDate <= date(vCalDate) , [Invoiced Quantity] ,0))


no need to aggregation


I think stdev not work on set analysis

Thanks for the input

sunny_talwar

Although, its good that your if statement solution works, but I would suggest you to try and make the set analysis work because set analysis tend to work better than if statement.... if you are interested to pursue this further, can you try this

Stdev({<Inc_CalendarDate = {">=$(=date(vCal12MonthBack))<=$(=date(vTodate))"}>} Aggr(Sum({<Inc_CalendarDate = {">=$(=date(vCal12MonthBack))<=$(=date(vTodate))"}>} [Invoiced Quantity]), Inc_Country))

Also, what is the format for Inc_CalendarDate? How do you create this in the script?