Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

average YTD as at x month in a table

Hi,

I would like to build a line chart that displays average score YTD as at X month as below

chart.png

The raw data looks like this

   

IdDateScore
105-01-164
206-01-164
606-03-161
1406-01-174
1726-02-172
1806-03-173
1915-12-172
2505-01-184
2606-01-181
2805-02-181
2926-02-184

The desired outcome is as follows

Year-Month     Average Score

Jan 2016          Avg(Jan 2016)

Mar 2016          Avg(Jan-Mar 2016)

Jan 2017          Avg(Jan 2017)

Dec 2017          Avg(Jan-Dec 2017)

I have been trying to use set analysis formula but failed, probably my coding is not right. Can someone help me?

The sample data set is attached in excel

3 Replies
sunny_talwar

Try using this expression

Aggr(RangeSum(Above(Sum(Score), 0, RowNo()))/RangeSum(Above(Count(Id), 0, RowNo())), Year, Month)


Capture.PNG

Anonymous
Not applicable
Author

Thank Sunny,

Is there any way I can do it using Avg and set analysis expression for this problem?

sunny_talwar

Average might work, but why set analysis? not sure I understand? Is something not working with the current expression?