
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to use addmonths in set analysis?
My expression is
count(DISTINCT {1<[Referred to CPS]={'Y'},[Resolved_RTC Month] ={"$(=addmonths(today(),-1))"},[Resolved_RTC Year]={"$(=year(today()))"},BizvsNonBiz_Impact_Incidents={'Business Impacting Incidents'},DateType ={'Resolved_RTC'},[Resolution Code]-={"*Select Resolution Code*"}>}Id)
But my addmonths in expression is not working correctly. I need to calculate the tickets resolved only for the previous month at any given point in time..can somebody please tell me whats going wrong with my set analysis? When i add the addmonths expression my expression stops working completely.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
What I can make out from your set analysis is you are using a Month field "[Resolved_RTC Month]" to get the month and the search parameter you have passed is "{"$(=addmonths(today(),-1))"}", which will return a date and not the month and that is the reason why your set analysis is not working.
Your set analysis should be as below.
count(DISTINCT {1<[Referred to CPS]={'Y'},[Resolved_RTC Month] ={"$(=Month(addmonths(today(),-1)))"},[Resolved_RTC Year]={"$(=year(today()))"},BizvsNonBiz_Impact_Incidents={'Business Impacting Incidents'},DateType ={'Resolved_RTC'},[Resolution Code]-={"*Select Resolution Code*"}>}Id)
Regards,
Kaushik Solanki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
What I can make out from your set analysis is you are using a Month field "[Resolved_RTC Month]" to get the month and the search parameter you have passed is "{"$(=addmonths(today(),-1))"}", which will return a date and not the month and that is the reason why your set analysis is not working.
Your set analysis should be as below.
count(DISTINCT {1<[Referred to CPS]={'Y'},[Resolved_RTC Month] ={"$(=Month(addmonths(today(),-1)))"},[Resolved_RTC Year]={"$(=year(today()))"},BizvsNonBiz_Impact_Incidents={'Business Impacting Incidents'},DateType ={'Resolved_RTC'},[Resolution Code]-={"*Select Resolution Code*"}>}Id)
Regards,
Kaushik Solanki


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What format is the field [Resolved_RTC Month]?
It looks like you are comparing a month field with a date field (from AddMonths()).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Kaushik
count(DISTINCT {1<[Referred to CPS]={'Y'},[Resolved_RTC Month] ={"$(=Monthname(addmonths(today(),-1)))"},[Resolved_RTC Year]={"$(=year(today()))"},BizvsNonBiz_Impact_Incidents={'Business Impacting Incidents'},DateType ={'Resolved_RTC'},[Resolution Code]-={"*Select Resolution Code*"}>}Id)
Thanks it worked but i used monthname instead of month

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jonathan
I was using an incorrect format of month while comparing and rectified it by the above solution..thanks for the suggestion
