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: 
FionnM
Contributor III
Contributor III

Only show purchase orders from the last 7 days

Hi folks,

I have a straight table in Qlikview which I want to show all the purchase orders raised in the last 7 days. The expression reads like this:

 

=Sum({<[Purchase Order Date]={'>=$(=WeekStart(Today()))<=$(=Today())'}>} [Purchase Order Line Cost])

 

 

This does almost exactly what I want it to do, except that NPrint publishes the report on a Friday, meaning it will only show purchase orders raised since Monday; it won't show purchase orders raised over the weekend.

How do I get the expression to show purchase orders raised in the last 7 days exactly?

Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
FionnM
Contributor III
Contributor III
Author

I figured it out. The solution was to create a variable called "v7DatesAgo", defined as "=date(Today()-7)".

The expression then reads 

=sum({<[Purchase Order Date] = {'>=$(v7DatesAgo)'}>}[Purchase Order Line Cost])

This did exactly what I needed it to do.

View solution in original post

5 Replies
saranyadurai
Contributor III
Contributor III

Hi @FionnM ,

You can try this,

In Main section, you can change the statement like this

SET FirstWeekDay=5,

it will show the Date from Saturday onwards,

Thanks

FionnM
Contributor III
Contributor III
Author

Is this in Qlikview or QlikSense?

saranyadurai
Contributor III
Contributor III

It's same for both.

FionnM
Contributor III
Contributor III
Author

Thanks for the suggestion. I think that would do the trick for this specific table, but I have other tables in the same app for which I need the first day of the week to be Monday.

FionnM
Contributor III
Contributor III
Author

I figured it out. The solution was to create a variable called "v7DatesAgo", defined as "=date(Today()-7)".

The expression then reads 

=sum({<[Purchase Order Date] = {'>=$(v7DatesAgo)'}>}[Purchase Order Line Cost])

This did exactly what I needed it to do.