Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nihhalmca
Specialist II
Specialist II

Standard Deviation in Chart (Bell Curve)

Hi All,

I have to calculate average and standard deviation of sales count (year wise). attached sample data here.

Could you please assist on this.

Thanks,

Nihhal.

22 Replies
shiveshsingh
Master
Master

yearwise means you need salesperson average?

Anonymous
Not applicable

try this

nihhalmca
Specialist II
Specialist II
Author

‌yes shivesh, i have to show standard deviation in bell chart.

Anonymous
Not applicable

try change the dimension to saleperson or year if you want year

std dev =  aggr( nodistinct Stdev(   num([SALES COUNT]) ),SALESPERSON)

avg = aggr(nodistinct avg(num([SALES COUNT])),SALESPERSON)

nihhalmca
Specialist II
Specialist II
Author

Hi Rodell, thanks for your response.

And I have checked attachment, it seems unexpected values.

As per your attachment, for year (2014), sales count values as 100, 120, 110 and avg values  as follows 110, 110, 110

and stdev values as follows 10, 10, 10. I am suspecting here i think stdev values should follow as -10, 10, 0.

what you say? please advice  if am wrong.

Nihhal.

Anonymous
Not applicable

hi Nihhal

you are seeing repetitive values because of the NO DISTINCT clause I put in the aggregation function.

for the sake of example and you can remove that

/*avg and std dev per person */

from

std dev =  aggr( nodistinct Stdev(   num([SALES COUNT]) ),SALESPERSON)

avg = aggr(nodistinct avg(num([SALES COUNT])),SALESPERSON)

to

std dev =  aggr(  Stdev(   num([SALES COUNT]) ),SALESPERSON)

avg = aggr( avg(num([SALES COUNT])),SALESPERSON)

/*avg and std dev per year */

from

std dev =  aggr( nodistinct Stdev(   num([SALES COUNT]) ),YEAR)

avg = aggr(nodistinct avg(num([SALES COUNT])),YEAR)

to

std dev =  aggr(  Stdev(   num([SALES COUNT]) ),YEAR)

avg = aggr( avg(num([SALES COUNT])),YEAR)

shiveshsingh
Master
Master

Hi,

Please use dimension as YEAR and expression as aggr(Avg([SALES COUNT]),YEAR) for Average

aggr(Stdev([SALES COUNT]),YEAR) for SD

nihhalmca
Specialist II
Specialist II
Author

‌sure i will try this and actually i need to show standard division like bell chart (graphical) not in table charts.

shiveshsingh
Master
Master

ok , let me check for bell one.