Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis: sum of amount when date in range not working

Hi Guys,

I'm trying to use set analysis and get the sum of a field called "count_recommendations" when its date is in range.

I'm using the following:

sum({<DateOnly= {'<=$(=vYesterday) >=$(=v3days)'}> } count_recommendation)

but the results show only 0.

vYesterday and v3days are variables that are set to recieve yesterday and 3 days ago dates respectively.

Am I using the wrong syntax? because an other question here with that topic was resolved with that answer....

can you help?

14 Replies
Not applicable
Author

FYI,

When you define the variables in Variables overview you have to use =

Eg.

vYes

=Today()-1

MK_QSL
MVP
MVP

Looks like your problem is non matching format..

You can use something like below..

sum({<DateOnly= {'<=$(=Date(vYesterday),'DD/MM/YYYY') >=$(=Date(v3days),'DD/MM/YYYY')'}> } count_recommendation)

DD/MM/YYYY need to be changed as per your Date format...

Anonymous
Not applicable
Author

The expression itself looks fine.  The problem is likely with the date format.  Variables must have the same format as the field Date.  Or formatted directly in the set expression, maybe:
sum({<DateOnly= {'<=$(=date(vYesterday)) >=$(=date(v3days))'}> } count_recommendation)

It would be easy to resolve if you upload an example

Not applicable
Author

That seem to be my Problem!!

Now it seem to work...

Not applicable
Author

Thank you all so much for you help!

the issue is now fixed...my expression was correct there was a problem in the variable...