6 Replies Latest reply: Jul 10, 2014 5:11 AM by Michael Diepold

# Problem with Alternate States-Expression

Hello everybody,

i have a little problem with visualizing an alternate-states-expression within a table chart.

My intention is to compare two month-based costs of a material. In a further step i'd like to calculate the difference between the two values but at the moment i have an other problem.

Have a look at the following screenshot:

The chart table has the dimensions 'Material' and 'Period'. The first expression shows the costs for the material for the 3 selected periods (april, may, june).

The second expression uses the alternate state 'Basis' and the selection of the listbox "Monat Basis". The expression is sum({Basis <[Material] = \$::[Material]>} [Material Costs]).

I expected that i get 1,62 in all 3 lines. Unfortunately it shows just 1,62 for June. The values for may and april are 0.

How can i geht the values for both periods ('Basis' and '\$') in 1 chart, so that i can do further calculations with the columns?

• ###### Re: Problem with Alternate States-Expression

HI

In Monat you have selected 3 b but look in Monat basis the associated value is june only thats y it is giving 0 values

check it once and let me know

• ###### Re: Problem with Alternate States-Expression

that's right. But i want to compare

"June" with Basis-"June"

"May" with Basis-"June" and

"April" with Basis-"June".

My ambition is that the chart shows the following values:

june      - expr. 1: 1,62      - expr. 2 (Basis): 1,62

may     - expr. 1: 1,63       - expr. 2 (Basis): 1,62

april     - expr. 1: 1,63       - expr. 2 (Basis): 1,62

• ###### Re: Problem with Alternate States-Expression

try

sum({Basis <[Material] = \$::[Material]>} TOTAL  [Material Costs])

-Rob

http://robwunderlich.com

• ###### Re: Problem with Alternate States-Expression

Thanks für your tip. I think it's almost the solution.

The result now looks like this:

but it's only working when i have selected just 1 material. when i want so see the values for all materials i geht the following:

Seems like "total" leads to ignore all dimensions and the expression now provides the sum of june-basis-values of all materials.

• ###### Re: Problem with Alternate States-Expression

Add the Material Dimension to TOTAL.

sum({Basis <[Material] = \$::[Material]>} TOTAL<Material> [Material Costs])

-Rob

• ###### Re: Problem with Alternate States-Expression

Perfect! Works!

Thank you very much!!