10 Replies Latest reply: Mar 5, 2018 9:15 AM by Saksham Kaul

# Alternate states syntax

Hi,

Could someone explain me the following syntax from the examples in getting started QV11?

num(Sum({[Group 1]<[Product Sub Group]=, Path = \$::Path, Region = \$::Region, Year = \$::Year, Quarter = \$::Quarter, Month = \$::Month>} Sales)/1000, '#,##0')

and the corresponding one for the alternate state is

num(Sum({[Group 2]<[Product Sub Group]=, Path = \$::Path, Region = \$::Region, Year = \$::Year, Quarter = \$::Quarter, Month = \$::Month>} Sales)/1000, '#,##0')

• ###### Alternate states syntax

Hi,

From the below expression

num(Sum({[Group 1]<[Product Sub Group]=, Path = \$::Path, Region = \$::Region, Year = \$::Year, Quarter = \$::Quarter, Month = \$::Month>} Sales)/1000, '#,##0')

in this part {[Group 1]<[Product Sub Group]=

Group 1 is alternate state it calculates based on the field selection in that states.

Path = \$::Path

from this

\$ means default state where you can change it to [Group 2] which is another state.

\$::Path which synchronizes selection with the specified alternate field(here it is default state for the field Path).Its simply like assigns the Default state selection of the field Path to the Path of the Group 1 alternate state.

Celambarasan

• ###### Alternate states syntax

Thanks,

I have additionnal questions though: for the expressions [product Sub Group], it seems to be a drill down group, however, when creating the list boxes of each groups (alternative states), it is not possible to build a definition with a drill down group...should I just write it down?

• ###### Alternate states syntax

Moreover I can't manage to link the 2 list boxes corresponding to each groups from the 2 alternatives states to the bar chart representing the comparison.

-Here is the expressions of each of my list box groups:

Group1:
num(Sum({[Group 1]<[Energy Consumer sub group]=, Country = \$::Country, Years = \$::Years,>}Quantity)/1000,'#,##0')

Group 2:
num(Sum({[Group 1]<[Energy Consumer sub group]=, Country = \$::Country, Years = \$::Years,>}Quantity)/1000,'#,##0')

-And the expressions of my bar chart supposed to compare both groups:

Group1
sum({[Group 1]<Country = \$::Country, [Energy Consumer Type]= \$::[Energy Consumer Type], Year = \$::Year>} Quantity)

Group2

sum({[Group 1]<Country = \$::Country, [Energy Consumer Type]= \$::[Energy Consumer Type], Year = \$::Year>} Quantity)

Do you see any wrong formulation?

• ###### Alternate states syntax

quantity being related to Energy consumer type

• ###### Alternate states syntax

Hi,

Can you explain what you trying to do exactly?

Celambarasan

• ###### Alternate states syntax

Hi,

Are you looking for the way to compare two alternate states?if so then your expressions should be

Group1:

sum({[Group 1]} Quantity)

Group2:

sum({[Group 2]} Quantity)

Celambarasan

• ###### Alternate states syntax

Yes thanks ! that's it, but how do you plot this comparison made in a bar chart such as in the example?

• ###### Alternate states syntax

Hi,

Use these expressions as expression in bar chart.

Celambarasan

• ###### Alternate states syntax

Indeed!
Simple as it is

Many thanks

• ###### Re: Alternate states syntax

I am using following expression to calculate growth%

=Num(((sum({StateB<Year=\$ Year,Month=\$ Month>} [inv value] / Sales_INR_Unit) -

sum({StateA<Year=\$ Year,Month=\$ Month>} [inv value] / Sales_INR_Unit)) /

Sum({StateA<Year=\$ Year,Month=\$ Month>} [inv value] / Sales_INR_Unit) * 100),'#,##0.0')

But i am not getting the result.

I want to calculate growth% on basis of current selection ie(if users select 2016 as year from 1st multibox) and (if user selects 2017 as year from 2nd multibox) then growth% should be calculated on basis of user selection. I have also maintained state for three different Multi Boxes ie StateA(for 1st Miltibox ), StateB(for 2nd Multibox) and StateC(for #rd multibox)