Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

evgeniystuchalk
Contributor II

'today' condition in set analysis

Hello!

How set 'today' condition in set analysis?

I want to see some measures, related only to current day, without filtering.

This code does nothing.

Count({$<[date]={'=today()'}>} [contactID])

What is wrong?

1 Solution

Accepted Solutions
MVP
MVP

Re: 'today' condition in set analysis

Oops, I missed a parenthesis at the end:

Count({$<[date]={"$(=Date(Today(), 'DD.MM.YYYY'))"}>} [contactID])

11 Replies
MVP
MVP

Re: 'today' condition in set analysis

Try this:

Count({$<[date]={"$(=Date(Today(), 'DateFieldFormatHere')"}>} [contactID])


Add the date field format in place of this -> DateFieldFormatHere

evgeniystuchalk
Contributor II

Re: 'today' condition in set analysis

nope, it gives null as result. tryed today(), tryed integer number - all with same results

Re: 'today' condition in set analysis

Does your date have a timestamp?

Count({$<[date]={'$(=timestamp(today()))'}>} [contactID])

Employee
Employee

Re: 'today' condition in set analysis

mmm I tested with the following instruction without problems .. Sum({<date={"=Today()"}>} contactID) ..

another point is: What is the format of your date field, Is it Date or Timestamp?

MVP
MVP

Re: 'today' condition in set analysis

Check these links to make sure dates are read as dates:

Get the Dates Right

Why don’t my dates work?

And this one to understand how is date used in set analysis:

Dates in Set Analysis

evgeniystuchalk
Contributor II

Re: 'today' condition in set analysis

Is solid Date. 'DD.MM.YYYY'

MVP
MVP

Re: 'today' condition in set analysis

So this didn't work?

Count({$<[date]={"$(=Date(Today(), 'DD.MM.YYYY')"}>} [contactID])

Also, make sure that date is not Date (with upper case D) or DATE (or all upper case) and same is with all your other fields.

Employee
Employee

Re: 'today' condition in set analysis

Can you share your QVW file with few records?

evgeniystuchalk
Contributor II

Re: 'today' condition in set analysis

Unfortunately, your formula return null in my case. All syntax is correct, i've double cheked it.