Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

STDEV for count of incidents by week - qvw attached

I need to calculate standard deviation for the attached and show a line for 1 standard deviation above and below the average.  Any help is appreciated.

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

You need to create the week number in the script, and then create an expression

Avg(total Aggr(Count(DISTINCT Ticket_Number),[Week Number])) +

StDev(total Aggr(Count(DISTINCT Ticket_Number),[Week Number]))

HIC

View solution in original post

5 Replies
hic
Former Employee
Former Employee

You need to create the week number in the script, and then create an expression

Avg(total Aggr(Count(DISTINCT Ticket_Number),[Week Number])) +

StDev(total Aggr(Count(DISTINCT Ticket_Number),[Week Number]))

HIC

Anonymous
Not applicable
Author

This works but adding week number using DATEPART(wk,Opened_At) shows 12/31/2013 as week 53.  This is outside QV since my new issue is DATEPART issue.  Thanks!

Anonymous
Not applicable
Author

Also, do you know why we can't do WEEK(Opened_At) in the AVG or STDEV function and week number has to come in during data load?

swuehl
MVP
MVP

You can try (edit: assuming Transact-SQL) using

DATEPART(isowk,Opened_At)

or use QV functions like Week() in a preceding LOAD:

LOAD

     Date,

     Week(Date) as Week;

SQL SELECT

     Date

FROM ...;

Anonymous
Not applicable
Author

I was able to use cwk and data matched.  Thanks everyone!