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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
elenarelinque
Creator
Creator

Comparing week with actual week

Hi!

I have data regarding the production of a factory. I want to know the amount of production running late. I need to show the production belonging to weeks prior to the current one.

I have tried like this:

=Sum({$<[Date.autoCalendar.Week]={<week((Today(0)), 0, 0 , 3)}>}[Production])

And this:

=If([Date.autoCalendar.Week]<Week((Today(0)), 0, 0 , 3),sum([Production]))

I explain the fileds:

Date.autoCalendar.Week: Is the field created by Qliksense using my field "Date"

Week((Today(0)), 0, 0 , 3): Is the function thet returns the actual week

Production: Is the field with the cuantity of production

 

 

 

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

 

Try

 

=Sum({$<[Date.autoCalendar.Week]={"<$(=week((Today(0)), 0, 0 , 3))"}>}[Production])

 

Or

=Sum(If([Date.autoCalendar.Week]<Week(Today(0), 0, 0 , 3),[Production]))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

 

Try

 

=Sum({$<[Date.autoCalendar.Week]={"<$(=week((Today(0)), 0, 0 , 3))"}>}[Production])

 

Or

=Sum(If([Date.autoCalendar.Week]<Week(Today(0), 0, 0 , 3),[Production]))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
elenarelinque
Creator
Creator
Author

It works! Thank you so much!