Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
edg
Partner - Contributor II
Partner - Contributor II

StDev Function results only displaying in totals

I need to use the StDev function to display a value across multiple rows of data using two dimensions. However, the value I need only shows up in the total.

I've tried the following, including using nodistinct in the aggr function:

stdev(aggr(count([X]),[Month_Year]))

stdev(aggr(count([X]),[Month_Year], [Product Name]))

Product NameMonth_YearCount of XSt. Dev
Product11-2021867-
Product12-2021842-
Product13-20211043-
Product14-2021946-
Product15-2021886-
Product16-2020686-
Product16-2021189-
Product17-2020705-
Product18-2020723-
Product19-2020807-
Product110-2020863-
Product111-2020771-
Product112-2020804-
Totals  203
    

 

This is how it should display:

Product NameMonth_YearCount of XSt. Dev
Product11-2021867203
Product12-2021842203
Product13-20211043203
Product14-2021946203
Product15-2021886203
Product16-2020686203
Product16-2021189203
Product17-2020705203
Product18-2020723203
Product19-2020807203
Product110-2020863203
Product111-2020771203
Product112-2020804203

 

On a side note, the function works in another table without the date and the following syntax.

STDev(aggr(count(distinct [X]), [Month_Year], [Product Name]))

 

1 Solution

Accepted Solutions
sunny_talwar

Then do this

StDev(TOTAL <Product, Date> Aggr(Count(DISTINCT [X]), [Month_Year], [Product Name]))

View solution in original post

6 Replies
sunny_talwar

Try this

StDev(TOTAL Aggr(Count(DISTINCT [X]), [Month_Year], [Product Name]))
edg
Partner - Contributor II
Partner - Contributor II
Author

Thank you Sunny! This is close. Please see attached.

sunny_talwar

Still not what you want?

edg
Partner - Contributor II
Partner - Contributor II
Author

No, I need it to show standard deviation by Product and Date regardless of the selection. Currently it shows it by the current selection.

For example.

Product    Date    Count    Std. Dev (required)        Std. Dev (now)

1                  6/20         2              .7                                                2.6

1                  6/20         3              .7                                               2.6

2                  6/20         5              2.1                                             2.6

2                 6/20          8             2.1                                             2.6

 

Thank you!

sunny_talwar

Then do this

StDev(TOTAL <Product, Date> Aggr(Count(DISTINCT [X]), [Month_Year], [Product Name]))
edg
Partner - Contributor II
Partner - Contributor II
Author

This works when I remove Date from the Total. Thank you!