Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ziabobaz
Contributor II

bar chart with averages per day of week

Hi, I am trying to build a bar chart with average sales per day of the week for the chosen period, but my formula returns Sales (not Average sales). What is wrong? Thank you!


avg(

aggr( Sum(Sales), [DayOfWeek_Field] )

)         

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: bar chart with averages per day of week

May be like this

Avg(Aggr(Sum(Sales), DayField))

9 Replies
omarbensalem
Esteemed Contributor

Re: bar chart with averages per day of week

maybe, as dimension, put DayOfWeek_Field and as a measure:Avg(Sales)?

MVP
MVP

Re: bar chart with averages per day of week

Are you doing this in a text box object or a table?

omarbensalem
Esteemed Contributor

Re: bar chart with averages per day of week

Bar chart..

MVP
MVP

Re: bar chart with averages per day of week

That's right... just totally ignored the title of the post

ziabobaz
Contributor II

Re: bar chart with averages per day of week

it's not working

Screenshot_52.jpg

omarbensalem
Esteemed Contributor

Re: bar chart with averages per day of week

What do you excpect as a result?

MVP
MVP

Re: bar chart with averages per day of week

May be like this

Avg(Aggr(Sum(Sales), DayField))

ziabobaz
Contributor II

Re: bar chart with averages per day of week

Average sales by day of week:

Screenshot_53.jpg

If i choose March, it should return Sum(<Monday> Sales)/count(<Monday> DaysOfWeek) and put it in the first Bar.

BTW, this works form me - I just wanted to apply a nicer solution.

ziabobaz
Contributor II

Re: bar chart with averages per day of week

Solved.

I think I got the logic.

I tried to split by DayOfWeek in the formula but as long as it is already done by setting a Dimension, the [Date] field in the formula will suffice.

Thank you!