Qlik Community

Qlik Sense App Development

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

Announcements
IMPORTANT: Upcoming LEF Database Maintenance, Oct. 3rd - SEE DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Comparing Data Field with Today() Variable

Hello, Everyone!

I'm having some trouble with Set Analysis.

I'm trying to count products based on the last entry date on inventory, but there's a catch, I can't count products that arrived today or yesterday.
So far I got this:

Count(

{

      1

      <

          [Date]={'$(=Max({1}Data))'},

          [Inventory_Units]={0},

          [Inventory_Units_DC]]={">0"},

          [LastEntryDate]={"<$(Today()-1)"} <-- This part doesn't work, it seems like it's being ignored.

      >

    }

    [Product]

)

Please ignore the others filters, they work!

I tried a lot of combinations on this part [LastEntryDate]={"<$(Today()-1)"}, but none them worked.

Best regards,
Breno

6 Replies
Highlighted
Specialist
Specialist

First of all you need to put "=" in it

      [LastEntryDate]={"<$(=Today()-1)"},

then if not enough you can try to play around with date format

     [LastEntryDate]={"<$(=Date(Today()-1, 'DD.MM.YYYY'))"},

Highlighted
Specialist II
Specialist II

Hi,

maybe try this, it's working for me :

"<$(=date(today() -1))"

regards

Highlighted
Contributor
Contributor

Hey, Olivier.

Thanks for the response, but is not working for me.
I even tried to take the other filters out to test, but it returns an error:

Set.PNG

Error.PNG

Highlighted
Contributor
Contributor

Hello, Andrey.


Thanks for the response.

I tried this way too, I tried a lot of date formats, but none of them worked.

When I use the date field with no mask it returns this:
Format.PNG
So I tried [LastEntryDate]={"<$(=Date(Today()-10, 'YYYY-MM-DD hh:mm:ss[.fff]'))"} to see it would change but no success. It still returns the max date ignoring the last entry date.

Exp.PNG

Highlighted
Specialist
Specialist

Hi Breno, I did some tests and... Try this

[LastEntryDate]={"<$(=Date(Today()-10, 'YYYY-MM-DD hh:mm:ss.ffffff '))"}

Or maybe you can share you qvw

Highlighted
Contributor
Contributor

Andrey,

It worked perfectly. Thank you so much!