Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
Thanks for taking time to look at my question.
I want to calculate the monthly total quotes(for insurance) based on different areas.
First. I was trying to calculate the MTD (Month to Date) total quotes by using the expression as follow, I think it works.
=sum({<Month = {$(=Month(Today()))}, Year = {$(=Year(Today()))},QuoteDate=>}QuoteCount)
Then, I want to calculate the total quotes for previous two months separately(dynamic month): Dec( from Dec.1.2015--Dec.31.2015) and last year Novenmer,but I don't know how to do it. The data structure is as follow picture:
Can anybody help me with it? Thanks for all your help. Appreciate it!
Please post a sample qvw file with some representative data.
Hi,
are you calculating Month and Year field or it is already available in Database???
Considering you are calculating Month and Year field from QuoteDate
then
Expression for MTD
=sum({<QuoteDate={">=$(=date(monthStart(max(QuoteDate))))<=$(=date(max(QuoteDate)))"}>}QuoteCount)
MTD-1
=sum({<QuoteDate={">=$(=date(monthStart(addMonths(max(QuoteDate),-1))))<=$(=date(addMonths(max(QuoteDate),-1)))"}>}QuoteCount)
MTD-2
=sum({<QuoteDate={">=$(=date(monthStart(addMonths(max(QuoteDate),-2))))<=$(=date(addMonths(max(QuoteDate),-2)))"}>}QuoteCount)
Use AddMonths()
Regards