Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

Use Yesterday in expression

Hi,

please help me with this expression - cannot get it right:

Count({<[Posted Date]={"=date(today()-1)"}>} [Trans Amount])

I want to count the number of transactions that have a Posted Date of Yesterday.

Thanks in advance,

Gerhard

Labels (1)
1 Solution

Accepted Solutions
Not applicable

Count({<[Posted Date]={"$(=date(vYESTERDAY))"}>} [Trans Amount])

you use [Posted date] instead [Posted Date]

View solution in original post

13 Replies
tresB
Champion III
Champion III

gerhardl
Creator II
Creator II
Author

Thanks Tresesco,

but that's still not working. I now have:

Count({<[Posted Date]={"=$(=date(today()-1,'YYYY/MM/DD'))"}>} [Trans Amount])

But it gives me the same value as Count([Trans Amount])

tresB
Champion III
Champion III

you always have a scope of checking if the date(today()-1,'YYYY/MM/DD') producing the right date in right format. i guess the issue is with date format.

Not applicable

what is your date format?

gerhardl
Creator II
Creator II
Author

SET DateFormat='YYYY/MM/DD';

Load

DATE(DATE#( left([Posted Date],11), 'DD-MMM-YY')) as [Posted Date],

Not applicable

could you send small sample qvw file ?

tresB
Champion III
Champion III

Did you try - Count({<[Posted Date]={"=$(=date(today()-1,'DD-MMM-YY'))"}>} [Trans Amount]) ?

gerhardl
Creator II
Creator II
Author

Yes, that give me zero values.

gerhardl
Creator II
Creator II
Author

Please see attached.