Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Professor-Ambassador
Professor-Ambassador

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
Professor-Ambassador
Professor-Ambassador
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
Professor-Ambassador
Professor-Ambassador
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
Professor-Ambassador
Professor-Ambassador
Author

yes

ID

 

I tried this:

 

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

lorenzoconforti
Specialist II
Specialist II

Did it work?

jerryr125
Professor-Ambassador
Professor-Ambassador
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?