4 Replies Latest reply: Nov 26, 2014 2:31 AM by Ashif Tadvi

# How to get current selection of the alternate state?

Hi,

I have 2 alternate states (Main and sub). How do i get the current field selection of the state in my expression?

Basically i have 2 sheets and I do not want the field selected interfere with each other.

Sum( { [Sub] <[Count A] = \$::[Count A]>} [Budget Value] )

I wan to achieve something like

Sum( { [Sub] <[Count A] = [Main][Count A]?>} [Budget Value] )

• ###### Re: How to get current selection of the alternate state?

I manage to figure out as the following.

Sum( { [Sub] <[Count A] = { \$( = Concat({Main} DISTINCT Chr(39)&[Count A]&Chr(39), ',' ) ) } > } [Budget Value] )

It works but not sure it is the correct way of doing.

• ###### Re: How to get current selection of the alternate state?

Have you tried using the scope operator here, too:

Sum( { [Sub] <[Count A] = Main::[Count A] > } [Budget Value] )

or

Sum( { [Sub] <[Count A] = p(Main::[Count A]) > } [Budget Value] )

• ###### Re: How to get current selection of the alternate state?

whao. thanks buddy.

I use the scope operator and it works.

Sum( { [Sub] <[Count A] = Main::[Count A] > } [Budget Value] )

• ###### Re: How to get current selection of the alternate state?

Can you share the sample qvw solution?