Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
andrey_krylov
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'))"},

ogautier62
Specialist II
Specialist II

Hi,

maybe try this, it's working for me :

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

regards

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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

andrey_krylov
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

Anonymous
Not applicable
Author

Andrey,

It worked perfectly. Thank you so much!