5 Replies Latest reply: Nov 5, 2015 5:10 AM by kushal chawda

# Till last month data

Hi all,

I am trying to display the data till end of the last month in line chart.

Dimension:

if((Month(CanonicalDate)),Date(MonthEnd(CanonicalDate), 'MM/DD/YYYY'),NULL())

Measures:

1. Count({\$<DateType={'accessed'}>}invitation_id)

2. count({\$<user_signed={1},DateType = {'signed'}>}user_signed)

Regards,

Pramod

• ###### Re: Till last month data

Just use Month(CanonicalDate) or CanonicalDate as the dimension, and filter the expressions like:

=Count({\$<DateType = {'accessed'}, CanonicalDate = {"<=\$(=MonthEnd(Max(CanonicalDate)))"}>} invitation_id)

=Count({\$<user_signed = {1}, DateType = {'signed'}, CanonicalDate = {"<=\$(=MonthEnd(Max(CanonicalDate)))">} user_signed)

• ###### Re: Till last month data

Your expression is taking max of canonicaldate means present month.

I need till last month.

For ex:

Max(CanonicalDate) is 11-5-2015,  Then it will take present month end

How can i restrict to last month

• ###### Re: Till last month data

{"<=\$(=MonthEnd(Max(CanonicalDate), -1))"}

• ###### Re: Till last month data

Is this correct for count of two months

if(mod(Date(monthStart(CanonicalDate), 'MM/DD/YYYY'),2)=0,Date(monthStart(CanonicalDate), 'MM/DD/YYYY'),NULL())

• ###### Re: Till last month data

try

Count({\$<DateType = {'accessed'}, CanonicalDate = {"<=\$(=MonthEnd(addmonths(Max(CanonicalDate),-1)))"}>} invitation_id)