Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
rcandeo
Creator III
Creator III

how to create this average by year, but monthly

I have to create a char like the image where I bring the year average but aggregated monthly

The below expression works but for a fixed year. If I put this expression in a bar chart it does not work cause brings to me the average for just the initial year, not showing year by year and I cannot find why.

avg(aggr(sum({1<FAT_LNPROD={'DOB'},FAT_MONTH=>} FAT_QUANT), FAT_MONTH))

Captura de Tela 2018-11-05 às 11.41.53.png

1 Solution

Accepted Solutions
sunny_talwar

Try this may be

Avg({1} Aggr(Sum({1<FAT_LNPROD = {'DOB'}, FAT_MONTH>} FAT_QUANT), FAT_MONTH, FAT_YEAR))

View solution in original post

4 Replies
lironbaram
Partner
Partner

hi

your expression seems ok

if don't make any selections in your app does it works ?

you can try to add the set expression both to the aggr function and the external avg function

like this

avg({1<FAT_LNPROD={'DOB'},FAT_MONTH=>} aggr({1<FAT_LNPROD={'DOB'},FAT_MONTH=>} sum({1<FAT_LNPROD={'DOB'},FAT_MONTH=>} FAT_QUANT), FAT_MONTH))

sunny_talwar

Try this may be

Avg({1} Aggr(Sum({1<FAT_LNPROD = {'DOB'}, FAT_MONTH>} FAT_QUANT), FAT_MONTH, FAT_YEAR))

rcandeo
Creator III
Creator III
Author

This is perfect, thank you so much

rcandeo
Creator III
Creator III
Author

unfortunatelly it did no work, but thank you for your try