Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
How can expression 1 and 2 be amended to function in the same way as expression 3 please?
1. avg(aggr( Sum( Sales ), ReportMonth, Company))
2. StDev(total aggr( Sum( Sales), ReportMonth))
3. Sum( total <Company> Sales ) / Count( distinct Total ReportMonth)
The Qlik Sense table of data is below. The values in column 4 / 5 should match column 3 i.e split per Company and not across the entire dataset.
Company | ReportMonth | Sum( total <Company> Sales ) / Count( distinct Total ReportMonth) | avg(aggr( Sum( Sales ), ReportMonth, Company)) | StDev( total aggr( Sum( Sales), ReportMonth)) |
A | 201808 | 5,162 | 4227 | 1,035 |
A | 201809 | 5,162 | 5640 | 1,035 |
A | 201810 | 5,162 | 4438 | 1,035 |
A | 201811 | 5,162 | 6907 | 1,035 |
A | 201812 | 5,162 | 4479 | 1,035 |
A | 201901 | 5,162 | 4508 | 1,035 |
A | 201902 | 5,162 | 6520 | 1,035 |
A | 201903 | 5,162 | 5625 | 1,035 |
A | 201904 | 5,162 | 3613 | 1,035 |
A | 201905 | 5,162 | 6066 | 1,035 |
A | 201906 | 5,162 | 4735 | 1,035 |
A | 201907 | 5,162 | 5186 | 1,035 |
B | 201808 | 5,796 | 6580 | 1,035 |
B | 201809 | 5,796 | 4642 | 1,035 |
B | 201810 | 5,796 | 6949 | 1,035 |
B | 201811 | 5,796 | 4482 | 1,035 |
B | 201812 | 5,796 | 6391 | 1,035 |
B | 201901 | 5,796 | 5469 | 1,035 |
B | 201902 | 5,796 | 5376 | 1,035 |
B | 201903 | 5,796 | 6344 | 1,035 |
B | 201904 | 5,796 | 5034 | 1,035 |
B | 201905 | 5,796 | 6481 | 1,035 |
B | 201906 | 5,796 | 5837 | 1,035 |
B | 201907 | 5,796 | 5962 | 1,035 |
Many thanks,
Colin
ps. I'd like to be able to upload the dataset and sample app but cannot do so for some reason.
May be this
1. Avg(TOTAL <Company> Aggr(Sum(Sales), ReportMonth, Company))
2. StDev(TOTAL <Company> Aggr(Sum(Sales), ReportMonth, Company))
May be this
1. Avg(TOTAL <Company> Aggr(Sum(Sales), ReportMonth, Company))
2. StDev(TOTAL <Company> Aggr(Sum(Sales), ReportMonth, Company))
Thank you