1 Reply Latest reply: Nov 28, 2012 11:45 AM by Stefan Wühl

# Plotting bell curve/normal distribution/Gaussian

Hi, I havent been having any luck wih my normal distribution graph,

When I view my chart in table format these are the values that I have for some reason there is an error calculating the values around the mean

 Frequency Normal Frequency Normal Frequency -20 <= x < -15 1 0.000338372 - -15 <= x < -10 1 0.009322085 0.028161867 -10 <= x < -5 6 - - -5 <= x < 0 28 - - 0 <= x < 5 86 - - 5 <= x < 10 29 - - 10 <= x < 15 5 - - 15 <= x < 20 3 - - 20 <= x < 25 1 0.002968246 - 25 <= x < 30 1 0.000227747 0.007159788 30 <= x < 35 1 1.6E-5 0.000422699 40 <= x < 45 1 1.5E-9 2.7E-5 45 <= x < 50 1 1.4E-10 1.6E-9 - 20 - -

The first Column is the dimension - class(salesInc,5)

2nd colomn expression - expression count(distinct salesId)

3rd column -normdist( salesInc,avg({1} total salesInc),stdev({1} total salesInc),0 )

4th comumn - (normdist( salesInc ,avg({1} total salesInc),stdev({1} total salesInc))
-
normdist(above(salesInc),avg({1} total salesInc),stdev({1} total salesInc)))*
Count(DISTINCTsalesId))

I got help with these formulas from a previous post

http://community.qlik.com/message/285822#285822

• ###### Re: Plotting bell curve/normal distribution/Gaussian

That's probably because salesInc is ambiguous for all classes with a frequency higher than 1.

If you want a sampling point in the center of your class width, try maybe

(floor(salesInc,5)+ceil(salesInc, 5))/2

like

normdist( (floor(salesInc,5)+ceil(salesInc, 5))/2,avg({1} total salesInc),stdev({1} total salesInc),0 )

edit:

Ah, the same problem will persist using just floor() or ceil() function. Hm, maybe:

normdist( (floor(min(salesInc),5)+ceil(min(salesInc), 5))/2,avg({1} total salesInc),stdev({1} total salesInc),0 )

or

normdist( only((floor(salesInc,5)+ceil(salesInc, 5))/2),avg({1} total salesInc),stdev({1} total salesInc),0 )