

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to show data from last year in a table
Hello everyone,
I want to compare yesterday's data with data from the same date last year.
I'm using the following to get yesterday's data, and it works as expected:
=count({<[Call Date]={'>=$(=DayStart(today()-1))<$(=DayStart(today()))'}>} DISTINCT [Call Number])
I do however have problems getting the "same date last year" part to work. I have looked at many threads in this forum, and ended with this approach, which does not work:
=count({<[Call Date]={'>=$(=Date(Addyears(DayStart(today()-1),-1))<$(=Date(Addyears(DayStart(today()),-1))'}>} DISTINCT [Call Number])
Can someone give me help me with this?
Thanks,
Nic
- Tags:
- qlikview_scripting
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
can you try this
=Count({<[Call Date] = {">=$(=DayStart(AddYears(Today()-1, -1)))<$(=DayStart(AddYears(Today(), -1)))"}>} DISTINCT [Call Number])

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this
=Count({<[Call Date] = {">=$(=DayStart(AddYears(Today()-1, -1))) < $(=DayStart(AddYears(Today(), -1)))"}>} DISTINCT [Call Number])


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! I just tried it, it does return a result, but the result is not accurate. But you've put me on the right track!
I looks as if it was capturing a year of worth of data (from a year ago until yesterday) instead of just "yesterday last year".
I tried moving the parenthesis around, but no luck (i either end up with 0 or a number representing the complete data)...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
can you try this
=Count({<[Call Date] = {">=$(=DayStart(AddYears(Today()-1, -1)))<$(=DayStart(AddYears(Today(), -1)))"}>} DISTINCT [Call Number])


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried, it gives the same result. And it seems to be the exact same expression (might be wrong!).


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
=Count({$<[Call Date]={'$(=Date(Addyears(DayStart(today()))','$(=-1)))'}>}Distinct [Call Number])


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! This one returns 0...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Removed space before and after < in the set analysis


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Retried this morning, it worked right away!?!?!?!?!
thanks for you valuable help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Awesome!!
