Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
WiscoSippi
Creator
Creator

How to modify set analysis to sum all periods selected?

Set analysis: Sum({<[Fiscal Period Counter Month] = {"$(=max([Fiscal Period Counter Month]))"}>} [Sales])

This works perfectly for its intended purpose. However, when we make selections it defaults to the Max fiscal period month selected. How do I code it to use max month unless selections are made? I've tried a handful of IF statements but to no avail.

First image: June doesn't have an "EHV" sale so nothing is shown. Second image: Only April and May selected but only May sales are shown.

Capture.PNG

Capture2.PNG

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” — Antoine de Saint-Exupéry
1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try maybe something like

=Sum(

{<[Fiscal Period Counter Month] *= {"$(=If(GetSelectedCount([Fiscal Period Counter Month]),'*',max([Fiscal Period Counter Month])))"}>}

[Sales])


View solution in original post

4 Replies
swuehl
MVP
MVP

Try maybe something like

=Sum(

{<[Fiscal Period Counter Month] *= {"$(=If(GetSelectedCount([Fiscal Period Counter Month]),'*',max([Fiscal Period Counter Month])))"}>}

[Sales])


WiscoSippi
Creator
Creator
Author

Thanks! I used a modified version of this using the GetSelectedCount function. Didn't know it existed before.

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” — Antoine de Saint-Exupéry
swuehl
MVP
MVP

You are welcome.

How does your modification look like?

WiscoSippi
Creator
Creator
Author

I had to expand on it cover several scenarios and added a variable,vPeriodCurrentMonth, to contain the original Set Analysis

if(GetSelectedCount([Fiscal Period Month Year])=0 and GetSelectedCount([Profit Center Name])=0 and GetSelectedCount([LTC Type])=0 and GetSelectedCount([Customer Name])=0 and GetSelectedCount([MVA Class])=0

,

Sum( $(vPeriodCurrentMonth)

[Trans Sales]

)

+Sum( $(vPeriodCurrentMonth)

[Freight Sales]

)

+Sum( $(vPeriodCurrentMonth)

Rigging

),

Sum(

[Trans Sales]

)

+Sum(

[Freight Sales]

)

+Sum(

Rigging

))

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” — Antoine de Saint-Exupéry