Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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?

Thank you for your help

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Add the Material Dimension to TOTAL.


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


-Rob

View solution in original post

6 Replies
sasikanth
Master
Master

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

Anonymous
Not applicable
Author

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

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

try

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


-Rob

http://masterssummit.com

http://robwunderlich.com

Anonymous
Not applicable
Author

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.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Add the Material Dimension to TOTAL.


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


-Rob

Anonymous
Not applicable
Author

Perfect! Works!

Thank you very much!!