Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
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!