Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
qv_testing
Specialist II
Specialist II

Alternate State on GetSelectedCount

Hi Community,

I have one scenario for states.

I have two set of filters STATE1 and STATE2.

1. Category is Global filter - if I select State1 category, should be populate same value on State2. (Global filter should be same for State1 and State2)

2. below screen I have two textboxes with different calculation Sales and QTY.

It should be single textbox, If I select product Sales should be populate and If I select SubProd should be switch QTY on same text box.

Getselectedcount is not working for states...

I did try with =IF(GetSelectedCount(Product, False(), 'State1'), Sum(Sales), Sum(Sales)/Sum(Qty))

for reference have attached sample QVW file.

qv_testing_0-1614256803567.png

Hope it help!

Thanks in Advance!

Labels (1)
2 Solutions

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

maybe this:

=IF(GetSelectedCount(Product, False(), 'State1'), Sum( {State1} Sales), Sum( {State1} Sales)/Sum( {State1} qty))

I hope it can helps.

Best Regards

View solution in original post

qv_testing
Specialist II
Specialist II
Author

Hi @agigliotti , 

my expression in working fine, which I mention in main post.

I think not working in QlikView, in Qlik Sense working fine (I think mine QlikView is older version )

 

Anyway thank you for quick response 🙂 

View solution in original post

8 Replies
agigliotti
Partner - Champion
Partner - Champion

Hi @qv_testing 

To me it's not clear what is your actual result and the expected one in your qvw.

Best Regards 

qv_testing
Specialist II
Specialist II
Author

Thanks for quick reply!

1. If I select Category=A under State1, State 2 should be associate(Global filter for both, user needs one select to populate both sides)

qv_testing_0-1614260466234.png

2.  I have selected Product, below text box should be Sales value and If I select Subprod value should be switch to QTY on same textbox as shown below screen.

qv_testing_2-1614260608385.png

 

qv_testing_3-1614260649620.png

 

agigliotti
Partner - Champion
Partner - Champion

maybe this:

=IF(GetSelectedCount(Product, False(), 'State1'), Sum( {State1} Sales), Sum( {State1} Sales)/Sum( {State1} qty))

I hope it can helps.

Best Regards

qv_testing
Specialist II
Specialist II
Author

Already have tried, but not working

qv_testing_0-1614266401005.png

 

agigliotti
Partner - Champion
Partner - Champion

below the result i see using 12.50 version

agigliotti_0-1614267397064.png

It seems you have a different syntax to specify the state name.

qv_testing
Specialist II
Specialist II
Author

If I select Category=A under State1, State 2 should be associate(Global filter for both, user needs one select to populate both sides)

qv_testing_0-1614271872390.png

is this possible ??

 

agigliotti
Partner - Champion
Partner - Champion

you can try with the below calculated dimension:

=Aggr( only( {< Category = p( {State1} Category ) >} Category ), Category )

as expression in your Category field list box for State2.

Best Regards

qv_testing
Specialist II
Specialist II
Author

Hi @agigliotti , 

my expression in working fine, which I mention in main post.

I think not working in QlikView, in Qlik Sense working fine (I think mine QlikView is older version )

 

Anyway thank you for quick response 🙂