Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

show current and previous 2 months.

Hi,

I am trying to create a bar graph that shows the count(month) but does not show any data from two months prior to the current date. I have my dimension as Month and Expression as count(month).  That shows the graph with the correct numbers but i would like to only show the previous two month from the current date. I tried to create another expressions Sum({<Month={"$(=Max(Month)-2)"}>}[Month] but I think its wrong.

Any help is appreciated.

Thank you

16 Replies
Not applicable
Author

Topic Area

NumCompDateows_ComDateCompDateMonth
#Agri Commodity Definition2011-09-12 00:00:009/12/2011Sep
#Agri Swaps2012-10-12 00:00:0010/12/2012Oct
#Amend to July 14, 2011 Order for Swap Regulation2011-12-23 00:00:0012/23/2011Dec
#Amend to CPO and CTA Regulations Resulting from DF Act2012-11-05 00:00:0011/5/2012Nov
#Amend to CPO and CTA Regulations Resulting from DF Act
#Ben Ownership Reporting Requirements and Security-Based Swaps2011-07-16 00:00:007/16/2011Jul
#Business Affiliate Marketing and Disposal of Consumer Information Rules2012-09-21 00:00:009/21/2012Sep

#Business Affiliate Marketing and Disposal of Consumer Information

Rules

#Clearing Exemption for Swaps Between Certain Affiliated Entities
#Commodity Options2012-10-12 00:00:0010/12/2012Oct
MayilVahanan

HI

Try like this

=Count({<DateField={">=$(=AddMonths(Max(DateField),-2))"}>} CountField )

Its takes max(DateField) for example 05/11/2012 format DD/MM/YYYY

Calculate dated from 05/09/2012 to 05/11/2012 and count the values

Suppose want to calcualte from 01/09/2012 to 05/11/2012 , use MonthStart(AddMonths(Max(DateField),-2))

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi,

I tried the expression but again nothing. Keep getting an error message--> "no data to display."

When I use this expression :

Count({<ComplianceDateMonth={">=$(=AddMonths(Max(ComplianceDateMonth),-2))"}>} [ComplianceDateMonth]

)

I get a bar graph but with every date from sep-2010 to mar-2014 listed.  The dimension I use is a datemonth field (shows MM-YYYY).  It still is not showing the current date and  past 2 months.  Effective date calendar.jpg

MayilVahanan

Hi

Instead of using

[ComplianceDateMonth] field  , can you able to use Datefield(i.e. not the monthYear field but date field in the expression)

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi,

I changed it to:

Count

({<ows_ComplianceDate={">=$(=AddMonths(Max(ows_ComplianceDate),-2))"}>} [ows_ComplianceDate])

Dimension Limits.jpg 

My expression is DateTest which = Date(ows_ComplianceDate,'MMM-YYYY') as DateTest

Thank you for your help.

GabrielAraya
Employee
Employee

Hi .. Look this example ...

I hope it can be useful for you

Gabriel

Not applicable
Author

Thank you.  I have figured it out.

Also thank you Mayil Vahanan.  I would not have understood this without your imput.