Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

shabarish0587
New Contributor

Need to accumulate till selected month for that Year

Hi Guys,

                I need one help. i want to display accumulated data based on selection.

for example if i select  2019-06, it should accumulate  value from 2019-01 to 2019-06 and divided by count of year month value in chart. for example:

2019-01,2019-02,2019-03,2019-04,2019-05,2019-06

100,200,400,300,100,200

Total accumulation is 1300 till 2019-06 divided by 6(number of months till selected) expected answer is 216. can any one help me how to write the expression on this

1 Solution

Accepted Solutions
vhespinog
New Contributor III

Re: Need to accumulate till selected month for that Year

May be this

=sum({$<YearMonth={">=$(=Date(YearStart(YearMonth,0),'YYYY-MM')) <=$(=Max(YearMonth))"}>}Amount)
/
Num(Month(Max(YearMonth)))

 

see attached

 

View solution in original post

2 Replies
Victor_Alumanah
Contributor

Re: Need to accumulate till selected month for that Year

This may help, MTD

While we teach we learn
vhespinog
New Contributor III

Re: Need to accumulate till selected month for that Year

May be this

=sum({$<YearMonth={">=$(=Date(YearStart(YearMonth,0),'YYYY-MM')) <=$(=Max(YearMonth))"}>}Amount)
/
Num(Month(Max(YearMonth)))

 

see attached

 

View solution in original post