Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

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

Tags (1)
8 Replies

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

Not applicable

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

Could you share your document?

anderseriksson
Contributor III

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.

MVP
MVP

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.

Not applicable

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?

anderseriksson
Contributor III

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'

Not applicable

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 -.

please help on this.