Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Creator III
Creator III

Standard Deviation Formula

Hi - 

This seems pretty straight forward but it does not seem to work.

I have a numeric field and would like to calculate the standard deviation in a KPI.

Not working:

Field Name : AmountSpent

 

=StDev([AmountSpent])

 

Thoughts ? Jerryr

1 Solution

Accepted Solutions
lorenzoconforti
Specialist II
Specialist II

That one in your chart is not a KPI object, it's a filter pane. 

You just need to use the right object 🙂

View solution in original post

12 Replies
lorenzoconforti
Specialist II
Specialist II

What error is it giving you? 

In which object are you trying to calculate it?

Do you have null values?

jerryr125
Creator III
Creator III
Author

Hi

1.  I am getting an "Invalid Dimension" error.

2. KPI

3. No null values

 

* Note: I am using the same field for Min, Max and Average KPI - no issues.

 

 

lorenzoconforti
Specialist II
Specialist II

Strange; try rebuild the aggregation in the KPI object

 

Something like this:

StDev(aggr(avg(AmountSpent), YourDimension))

 

replace avg with the aggregation you are performing (if none, just use only()) and YourDimension with the relevant dimension 

jerryr125
Creator III
Creator III
Author

Hi - I tried this :

 

=StDev(aggr(avg(), [AmountSpent]))

 

Again - no luck.

In my data, I have a field 'AmountSpent' in which I would like the Average, Min, Max and Standard Deviation.

There is no null values - only numbers > 0.00

I would like to display this as a KPI 

 

Any thoughts ? Jerry

lorenzoconforti
Specialist II
Specialist II

In your data, do you have a dimension that identifies each observation? Like a transaction id that is unique for each row?

 

jerryr125
Creator III
Creator III
Author

yes

ID

 

I tried this:

 

=StDev(aggr(avg([AmountSpent]), [ID]))

lorenzoconforti
Specialist II
Specialist II

Did it work?

jerryr125
Creator III
Creator III
Author

hi - sorry - no that did not work

lorenzoconforti
Specialist II
Specialist II

Does it still give you invalid dimension? Any chance you can post the application?