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: 
Husky_Bab12
Contributor
Contributor

Set analysis With difference in date

Hi ,

I need to sum quantity based on input dates with below expression.

If the user enters 0 to 10 in the days input then I need to sum up the quantities between days 0 to 9 

And if the user gives input has 18 to 25 , I need to some up quantities from 18 to 25 days

 similarly , it needs to sum the quantity based on user input.

So the beginning date in the shift date always has the current date.

For example, if today is 2022-09-05. The Shift Date has date starting from 2022-09-05. And the end date is 70 days from current date.

I'm not sure whether I've defined the variable in a correct way.

Please, some one help let me know where I'm going wrong


=sum({<$(='[Shift Date]')={">=$(vStart)<=$(vEnd)"}>} Quantity)

output : 0

The shift date is in the format, 2022-09-02. 

I'm receiving 0 no matter the input I give on vStart and vEnd.

Where the variables are defined as  vStart= 0 and vEnd = 0. 

Labels (1)
2 Replies
Vegar
MVP
MVP

Try this:

=sum({<[Shift Date]={">='$(vStart)'<='$(vEnd)'"}>} Quantity)

I am assuming that both Shift Date, vStart and vEnd are formated as your application default date format.

SunilChauhan
Champion II
Champion II

use below

Sum({<Quantity={">=$(vQuantityStart)<=$(vQuantityEnd)"},Date={">=$(vMinDate)<=$(vMaxDate)"}>}Quantity)

using attached Excel and  .qvf

 

you Can ENter min and Max Quanity , also Min Date and Result will Change according to entry.

 

Hope this helps

 

Sunil Chauhan