Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

gdelphin
New Contributor III

Today(1) in "set modifier"

Hello,

I've got an issue I can't explain.

I use a set modifier to filter on the today date.

This works fine (with the good date)

=Count( {$< [Code contrat]={'SISU*'},  [Date fermeture.autoCalendar.Date] = {'22/11/2017'} > } [N°]  )

This doesn't work (when I wqnt to select the date of the day)

=Count( {$< [Code contrat]={'SISU*'},  [Date fermeture.autoCalendar.Date] = today(1) > } [N°]  )

I've got the message "Erreur dans l'expresssion" (in french) : "Error in expression"

What I am missing?

1 Solution

Accepted Solutions
shraddha_g
Honored Contributor III

Re: Today(1) in "set modifier"

Try

Count( {$< [Code contrat]={'SISU*'},  [Date fermeture.autoCalendar.Date] = {"$(=date(floor(today(1)),'DD/MM/YYYY'))"} > } [N°] )

10 Replies
shraddha_g
Honored Contributor III

Re: Today(1) in "set modifier"

Try

Count( {$< [Code contrat]={'SISU*'},  [Date fermeture.autoCalendar.Date] = {$(=today(1))} > } [N°]  )

gdelphin
New Contributor III

Re: Today(1) in "set modifier"

Hello,

Thank you for you quick reply.

The error disapeared, but it doesn't return a result in my KPI object:

Capture.PNG

When I "harded code" the date string

=Count( {$< [Code contrat]={'SISU*'},  [Date fermeture.autoCalendar.Date] = {'22/11/2017'} > } [N°]  )

, I've got this result :

Capture.PNG

MVP
MVP

Re: Today(1) in "set modifier"

As above, with bold change

Count({$<[Code contrat] = {'SISU*'}, [Date fermeture.autoCalendar.Date] = {$(=Date(today(1), 'dd/MM/yyyy'))}>} [N°])

pradosh_thakur
Valued Contributor III

Re: Today(1) in "set modifier"

try today(1) in a text box and check the format you are getting. is it DD/MM/YYYY OR MM/DD/YYYY that could be the problem .Make sure it is in DD/MM/YYYY format by using date function.

regards

Pradosh

gdelphin
New Contributor III

Re: Today(1) in "set modifier"

The same result as

no result.PNG

gdelphin
New Contributor III

Re: Today(1) in "set modifier"

today(1) returns 22/11/2017

shraddha_g
Honored Contributor III

Re: Today(1) in "set modifier"

try,

Count( {$< [Code contrat]={'SISU*'},  [Date fermeture.autoCalendar.Date] = {$(=date(today(1),'DD/MM/YYYY'))} > } [N°]

gdelphin
New Contributor III

Re: Today(1) in "set modifier"

Same result

no result.PNG

shraddha_g
Honored Contributor III

Re: Today(1) in "set modifier"

Try

Count( {$< [Code contrat]={'SISU*'},  [Date fermeture.autoCalendar.Date] = {"$(=date(floor(today(1)),'DD/MM/YYYY'))"} > } [N°] )