Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Till last month data

Hi all,

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

but it is printing the value of this month also. Please help on it.

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

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

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

jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

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())

Kushal_Chawda

try

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