Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

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 = $:Smiley Tongueath, 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 = $:Smiley Tongueath, Region = $::Region, Year = $::Year, Quarter = $::Quarter, Month = $::Month>} Sales)/1000, '#,##0')

1 Solution

Accepted Solutions

Alternate states syntax

Hi,

     Use these expressions as expression in bar chart.

Celambarasan

10 Replies

Alternate states syntax

Hi,

     From the below expression

     num(Sum({[Group 1]<[Product Sub Group]=, Path = $:Smiley Tongueath, 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 = $:Smiley Tongueath

from this

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

$:Smiley Tongueath 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

Not applicable

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?

Not applicable

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?

Not applicable

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

Not applicable

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

Not applicable

Alternate states syntax

Indeed!
Simple as it is

Many thanks