Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There,
I want to create an expression to look at the the sameday on Current month and previous month, for instance
CM = 20160801 to 20160830
PM = 20160701 to 20160730
Many thanks,
Treasure
Maybe the inmonth() function is what you are looking for.
try addmonths(CM,-1)
how your Expression would look like to Combine sameday value of CM and PM?
Hi Rudolf,
I have two Charts (one showing CM and the other showing PM)
so on the current month chart(there's data from the first of this month until today),
and on the previous month chart(there's data from the first of the previous month until month end (20160731)
so I want to compare 30th of this month and the 30th of the pm
thanks,
you may use the Expression with addmonths in your Chart with PM
do you show each day of month in the Chart?
can you post sample qvw?
may be like this?
Create two variables
1. vCurrentMonth
=Max(Month)
and make ur expression like:
sum( {$<Year = {$(#vCurrentMonth)}>} Sales )
2. vLastMonth
=Max(Month-1)
sum( {$<Year = {$(#vLastMonth)}>} Sales )
or
For Current Month Sales:
=sum({<CalendarYear={$(=max(CalendarYear))},CalendarMonthName={$(=Month(Max(InvDate)))}>}INVC_ITEM_AMT)
For Last Month Sales:
=sum({<CalendarYear={$(=max(CalendarYear))},CalendarMonthName={$(=month(addmonths((max(InvDate)),-1)))}>}INVC_ITEM_AMT)
you wrote that you want to compare the sameday from current month and previous month
but you want to compare the current month vs previous month? or do you select the day by a selection box?
anyway: if you define the Expression for PM like
sum({<yourdatefield={'$(=addmonths(max/(yourdatefield),-1)'}>}value)
you select month: you get months value
you select day and month: you get value of this month/day
Hi Rudie, It worked(sum({<yourdatefield={'$(=addmonths(max/(yourdatefield),-1)'}>}value)),
THANK you so much