9 Replies Latest reply: Apr 25, 2017 7:44 PM by Henry Esparza

# set analysis count field =today()-30

I am trying to find out how many "open" tickets there were 30 days ago from todays date based on "date_opened," I am receiving an error with the below set analysis, I think it has to do with the "today-30" section, I've also tried today()-30.

Any help is much appreciated.

count({<date_opened={"today-30"}>}case_number)

• ###### Re: set analysis count field =today()-30

May be this

Count({<date_opened={"\$(=Date(Today() - 30))"}>}case_number)

• ###### Re: set analysis count field =today()-30

Monica, the comment above by Sunny did not work?
Count({<[date_opened]={"\$(=Date(Today()-30))"}>}[case_number])

• ###### Re: set analysis count field =today()-30

Can you share a sample app? To directly test on it?

It would be much quicker and more efficient

• ###### Re: set analysis count field =today()-30

Hi Omar, Please see the attached file.

I was wanting to add a second measure to the KPI on the left, "count of remaining open tickets" which would measure the count of how many tickets were open 30 days from today().

• ###### Re: set analysis count field =today()-30

Are you hoping to see 1,265 as the required number? May be this

Count(distinct{<case_number={'=Len(Trim(date_closed))=0'}, date_opened={"\$(='>' & Date(Today() - 30, 'M/D/YYYY'))"}>}case_number)

• ###### Re: set analysis count field =today()-30

Hi Sunny, I don't want to consider the closed_date for this portion of the analysis.

• ###### Re: set analysis count field =today()-30

May be this then

Count(distinct{<date_opened={"\$(='>' & Date(Today() - 30, 'M/D/YYYY'))"}>}case_number)

• ###### Re: set analysis count field =today()-30

Count({<date_opened={"\$(=Date(max(date_opened) - 30))"}>}case_number)

• ###### Re: set analysis count field =today()-30

try

=count({<date_opened={'\$(=today()-30)'}>}case_number)