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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
narayanaqlik
Creator
Creator

Rolling Sum in Set Analysis(Cumulative of last 12 months)

Hi All,

Kindly help in this, i had data field lets OrderDate of dates 'DD.MM.YYYY' 

OrderDate has contain 2001 to 2031 dates

My Expression is like    RangeSum(Above(Count({<OrderDate={">=AddMonths(MonthStart(Max(OrderDate)))<=$(MonthStart(Max(OrderDate)))"}>}OrderID),0,RowNo())) it is working fine based on selected date but here my question is 

By default it should be selected from today month to last 12 months irrespective of year.

RangeSum(Above(Count({<OrderDate={">=$(=AddMonths(MonthStart(Today())),-12)<=MonthStart(Today())"}>}OrderID) ,0,RowNo()))- But it is not working, it will not display current year data,  kindly help in this please correct me if i have done any wrong in my expression or Kindly provide me with your expression.

4 Replies
sunny_talwar

Try this

RangeSum(Above(
  Count({<OrderDate = {">=$(=MonthStart(Today(), -12))<=$(=MonthStart(Today()))"}>} OrderID)
, 0, RowNo()))
narayanaqlik
Creator
Creator
Author

ByDefault Current year should be selected 

If(GetSelectedCount(OrderDate)<0,RangeSum(Above(Count({<OrderDate={">=$(=MonthStart(Today(),-12))<=$(MonthStart(Today()))"}>}OrderID)),0,RowNo())),

RangeSum(Above(Count({<OrderDate={">=$(=AddMonths(MonthStart(Max(OrederDate)),-12)<=$(=MonthStart(Max(OrderDate)))"}>})))

)

Kindly Help in this here my Problem is if i am not selecting any date it should be selected current year rolling sum other wise selected year rolling 

but her it is not working it is displaying max year as cumulative values and rest it is showing all zeros even i am not selecting any year , 

 

if i am selecting particular then it is working fine but i want by default it should select from current month to last 12 months from current year

 

sunny_talwar

Not sure I am able to follow? Can you share a sample where we can see the issue?

Sthembiso745
Contributor
Contributor

Did you manage to get the solution for your problem? i'm facing the same problem, can you help if you can