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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error in Date Range Expression

The following expression has an error that I can't seem to resolve.  I checked other posts but can't get the error condition to resolve.  Any help would be apprecidated.

sum({$<LogisticsStartDate = {'>=$1/1/2011 12:00:00 AM<=12/31/2011 12:00:00 AM'}>ConsCommission)

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

I guess what you need is to add a '}' just before ConsCommission to close the Set Analysis part.

Of course another thing to check is the format of your dates to get correct values.

Hope this solves it.

View solution in original post

6 Replies
Not applicable
Author

Hi,

I guess what you need is to add a '}' just before ConsCommission to close the Set Analysis part.

Of course another thing to check is the format of your dates to get correct values.

Hope this solves it.

Not applicable
Author

Thanks JP,

I looked at that several times and missed it.  Calculating now.  Bill

Not applicable
Author

To take this a bit furthur, I need to test for Year as well, so that I don't sum yearly data other than the year identified.  I know this is not correct syntax but the 2nd line is the one succussfully agregates my data by year but I hope to add the 1st condition of the logistic startdate.

sum({$<LogisticsStartDate = {'>=$1/1/2011 12:00:00 AM<=12/31/2011 12:00:00 AM'}>}ConsCommission)

sum({<Year={
"2011"}>}ConsCommission)+ sum({<Year={"2011"}>}OCCommission)+ sum({<Year={"2011"}>}DiscCommission)

Not applicable
Author

You can link your date to a master calendar and thus be able to select a desired year, month, week, etc.

Your expression would look like this:

Sum(field1+field2+field3).

Or you can add 2 variables for the user to select his interval dates

and your expression would look like this:

Sum({$<Datefield={">=$(=Date(vInputDate1)) <=$(=Date(vInputDate2))"}>} field1+field2+field3)

Is that what your are trying to do ?

If not, you can provide more details and maybe a sample of your qvw and i'll be glad to help.

Not applicable
Author

JP,

Sorry for the delay. I haven't had a chance to explore your last suggestion to make it more flexible.  In the interim I was trying to get this statement to work,  However, I have an expression error that I can't figure out that should limit my data to LogisticsStartDate and Revenue Year = 2011.

sum ({$<DATE(LogisticsStartDate) = {'>=$1/1/2011<=12/31/2011'},Year = {"2011"}>}ConsCommission)

Not applicable
Author

JP,

Actually the single condition listed below provides my answer.  Thanks for your help.

Sum({$<LogisticsStartDate = {'>=1/1/2010 12:00:00 AM<=12/31/2010 12:00:00 AM'}>}ConsCommission)