Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

No results with set analysis

I use set analysis a lot and get (mostly) the results I expect.

I think next expression is rather simple but it dont gives any result.

In a table I have a date and an amount.

Now I want to compare total amount with the total amount of previous month.

Date is in a listbox.

I have a variable : only(addmonths(getfieldselections(date),-1))

The variable has the correct value when I show it in a textbox

To calculate total sum of previous month I use the expression

=sum({<date={$(variable)}>} amount)

But result = -

"

Must be a very simple expression I suppose, but just don't see what I am doing wrong

1 Solution

Accepted Solutions
swuehl
MVP
MVP

It's crucial to add context to any issue description.

As far as I understood, and what your original post is missing, you are trying to use your expression in a chart with dimension date and you expect the value for the previous month to appear on the line with the current month date.

Obviously, that's out of the aggregation scope.

You can circumvent this by adding the TOTAL qualifier to your sum aggregation:

Sum( TOTAL {YourSet}>} date)

View solution in original post

26 Replies
sunny_talwar

Do you have a single selection made in date field? Also, do you get the same format as your date field for the variable named "variable"? If the answer to the above two question is yes, then try this

=Sum({<date={"$(=variable)"}>} amount)

or this

=Sum({<date={"$(=$(variable))"}>} amount)

avinashelite

try like this

sum({<date={'$(variable)'}>} amount)

Anonymous
Not applicable

or this

=Sum({<date={"$(=Date($(variable)))"}>} amount)

curiousfellow
Specialist
Specialist
Author

It still doesn't work. Perhaps it's better I first start my weekend and try after the weekend again with a clear mind.

Thank you all for your quick respons.

Anonymous
Not applicable

What does the value of the variable show?  And what does your Date field look like?

As a shot in the dark you could try:

sum({<date={'(variable)'}>} amount)

curiousfellow
Specialist
Specialist
Author

The variable has the same format as the datefield itself. For instance 1-5-2017

Anil_Babu_Samineni

Can you tell us, How you define the variable?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
curiousfellow
Specialist
Specialist
Author

=only(addmonths(getfieldselections(date),-1))

Anonymous
Not applicable

You need to have it ignore the date selection and just use variable.  Like:

=sum({<date={'$(variable)'}, date=>} amount)