Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
BrianDH
Creator II
Creator II

Count of this week and of last week

I am trying to get a count of invoices for today and this same day last week.

=count(Invoice) for Today()

=count(Invoice) for Today()-7

Suggestions?

Labels (2)
8 Replies
sunny_talwar

Have you tried this?

Count({<Date = {"$(=Date(Today()))"}>} Invoice)

and for Today - 7

Count({<Date = {"$(=Date(Today()-7))"}>} Invoice)

 

BrianDH
Creator II
Creator II
Author

returns full 2 years of date.  count should be 9

Count({<INVOICE_DT = {"$(=Date(Today()))"}>}OB_VOUCHER_ID)

sunny_talwar

What is the format for INVOICE_DT?

BrianDH
Creator II
Creator II
Author

'yyyy-MM-dd'

BrianDH
Creator II
Creator II
Author

see image

sunny_talwar

Can you try this

Count({<INVOICE_DT = {"$(=Date(Today(), 'YYYY-MM-DD'))"}>}OB_VOUCHER_ID)
BrianDH
Creator II
Creator II
Author

it is ignoring everything and just showing the total count .

Count({<INVOICE_DT = {"$(=Date(Today(), 'YYYY-MM-DD'))"}>}OB_VOUCHER_ID)

Very odd.  I'd prefer an error 😜 

BrianDH
Creator II
Creator II
Author

This works in the backend.

LOAD
VOUCHER_ID AS Last_Week
, date(today()-7, 'yyyy-MM-dd') AS LDate
FROM [lib://QVD Files/PeopleSoft/AP_MANAGE_ONBASE.qvd](qvd)
where INVOICE_DT = date(today()-7, 'yyyy-MM-dd')