8 Replies Latest reply: Oct 24, 2015 8:01 AM by Kumar Pramod

# compare the count of today and yesterday

Hi all,

How can i compare the count of today and yesterday and i need the difference in percentage.

For ex:

Today count is 75 and yesterday count is 50 the difference is 25.

I need to display how much % is increased from yesterday to today.

Thanks,

pramod

• ###### Re: compare the count of today and yesterday

Are you a date calendar?

You could try with

Count({\$ <myDate={'\$(=Today())'}>} myValue)

/

Count({\$ <myDate={'\$(=Today()-1)'}>} myValue)

let me know

• ###### Re: compare the count of today and yesterday

yes, I am using date calendar.

Count({\$ <CanonicalDate={'\$(=Today())'}, DateType = {invitation}>} invitation_id)

/

Count({\$ <CanonicalDate={'\$(=Today()-1)'},DateType = {invitation}>} invitation_id)

I used like above i'm not getting the value.

• ###### Re: compare the count of today and yesterday

The principal is correct but you need to make sure the dates in set analysis is formatted as text and not numbers.

Your most likely problem is that Today()-1 is not a date but a number and thus the set analysis search will not work.

Try putting a Date(..) around it like Date(Today()-1) instead.

• ###### Re: compare the count of today and yesterday

Hi Pramod,

Try this

Count({\$ <CanonicalDate={'\$(=Today())'}, DateType = {invitation}>} invitation_id)

/

Count({\$ <CanonicalDate={'\$(=Date(Today()-1))'},DateType = {invitation}>} invitation_id)

Note: CanonicalDate & Today() should be in the same date format.

Regards,

Jagan.

• ###### Re: compare the count of today and yesterday

Count({\$ <CanonicalDate={'\$(=Date(Today()))'}, DateType = {invitation}>} invitation_id)

/

Count({\$ <CanonicalDate={'\$(=Date(Today()-1))'},DateType = {invitation}>} invitation_id)

Not working my canonicalDate is in this format :10-22-2015

Date(Today()) is in the format : 10/22/2015

Is both same?

• ###### Re: compare the count of today and yesterday

They are not! / is not same as -

You need a format string to the Date-function.

Format string should be 'MM-dd-yyyy'

• ###### Re: compare the count of today and yesterday

I am getting the count. The issue is:

for today() count is 84.

for today()-1 count is 81.

The count is perfect. Now i need show the percentage of difference and through conditional colors tab i need  to show it's + or -.