Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggregate 3 months data on set analysis

Good day,

I have a quarterly report that aggregates months data based on the quarter selected.

I have this expression on my object and it just doesn't return any thing,

is there some incorrect in my expression?:

Sum({<Year={"$(=Year(MAX(Date)))"},
Date={">=$(=MonthStart(AddMonths(Max(Date),-2)))<=$(=MonthEnd(AddMonths(Max(Date),+0)))"}
>}
WRITTEN_OFF_AMT)

Your assistance will be highly appreciated,

Mbini

8 Replies
sunny_talwar

Try this:

Sum({<Year, Date={"$(='>=' & Date(MonthStart(Max(Date), -2), 'DateFieldFormatHere') & '<=' & Date(MonthEnd(Max(Date), 0), 'DateFieldFormatHere))"}>}WRITTEN_OFF_AMT)

Not applicable
Author

I tried this:

Sum({<//Year,
Date={"$(='>='& Date(MonthStart(Max(Date),-2),'DD/MM/YYYY') & '<=' & Date(MonthEnd(Max(Date), 0),'DD/MM/YYYY'))"}>}WRITTEN_OFF_AMT)

And I still dont get anything!!

sunny_talwar

What are you getting and what do you expect to see?

Not applicable
Author

for this:

Date(MonthStart(Max(Date),-2)

I get: 01/04/2015


Date(MonthEnd(Max(Date), 0)

I get 30/06/2015

but when I have it on the expression as a whole:

Sum({<Year={"$(=Year(MAX(Date)))"},
Date={">=$(=MonthStart(AddMonths(Max(Date),-2)))<=$(=MonthEnd(AddMonths(Max(Date),+0)))"}
>}
WRITTEN_OFF_AMT)

I get no results

sunny_talwar

Would it be possible to share a sample?

Not applicable
Author

its quite a huge app i wont be able to share it over the net

jmvilaplanap
Specialist
Specialist

I normally try to convert all the dates to numbers (and if is possible round numbers).

For example, I use Floor(Date) AS Date and another table if I want to show formated dates in the dashboard.

With this solution I can opperate with dates without format problems.

Try to use the dates without format.