Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using stdev function

Hi folks,

I'm fairly new to QlikView, so this question may be very basic, but any help would be appreciated.

I have loaded a set of data, and am trying to calculate the standard deviation of the data set as an expression on a chart.

The problem I'm having is that while there are 3 years of data, the field I'm looking at (NBRFld) is null for the majority of the data set (only became valid a few months ago).

When I use:

Stdev( total NBRFld)

It seems to be calculating using all the null values, but I only want to calculate stdev for those with actual values.

I know there has to be a simple way to do this, but the syntax is escaping me. Thanks in advance for your help.

1 Solution

Accepted Solutions
Not applicable
Author

Did you try this expression ? If(not(isnull(NBRFld)),Stdev(total NBRFld)) ?

View solution in original post

3 Replies
Not applicable
Author

Did you try this expression ? If(not(isnull(NBRFld)),Stdev(total NBRFld)) ?

Not applicable
Author

OK, this seemed to have worked:

If(not(isnull(NBRFld)),Stdev(total NBRFld)) ?


Thank you...now, can you tell me why this works?

Because, it seems to me that the (isnull) should be inside the stdev somehow...

Not applicable
Author

By writing an if out od the StdDev feature, you will ask Qlikview to run the function only on valid fields. In this case you'll evalaute the field before running stddev function.

Happy that is worked.

Rgds,