Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
xarapre7
Creator II
Creator II

Aging cases for end of weeks or months or years

Hi Experts!


I want to show the sum of aging cases in a chart only for each day or last days of each week, each month or each year.

I have a cyclic group for Years, Months, Weeks or Days for user's selection.


What should be the correct expression for this?


Thank you in advance for your help.

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Using a drill down group with fields Year, Month, Week, Day as the dimension, and a date field (called [Date]) in your model, then something like

=If(GetCurrentField('ddCalendar') = 'Day',

  Sum(Amount),

  FirstSortedValue(Sum(Amount), -[Date])

)

Although just

=FirstSortedValue(Sum(Amount), -[Date])


would also work. Adjust the DD group and field names to your requirements.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
xarapre7
Creator II
Creator II
Author

Thank you for your immediate reply.  I tried both but it was giving me an error in expressions.

I have below expression which is pretty close to what i need as it's giving me the sum of Cases but, only for the latest SnapshotDate.  In the chart, it's just showing a bar for either Day, Week, Month or Year selection from the cyclic group (Date). 

=Num(sum({1} if(SnapshotDate =$(=Max(SnapshotDate)) and AgingFlag= 'Y', Cases)),'#,##0')

What I want to show is, the sum of aging cases just for the end of every month (in case, Month was selected from the cyclic group).  Example:  I have sum of aging cases for Jan 31=2,400; Feb 28=1,900; Mar 31=2,500.  These are the values that i want to see in the bar chart.  Can you please give the right expression?  Thanks in advance for your help!