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: 
NickHoff
Specialist
Specialist

GetSelectedCount Is this a bug?

I have the following logic in a text box that hides once all the criteria is met.

=IF(GetSelectedCount(TopFacility) = 0 And GetSelectedCount(JointSurgeonName) + GetSelectedCount(JointSurgeonNPI) = 0 AND GetSelectedCount(PhysGroups) = 1,'Please select a Facility and Surgeon.',

IF(GetSelectedCount(TopFacility) = 0 And GetSelectedCount(JointSurgeonName) + GetSelectedCount(JointSurgeonNPI) = 0 AND GetSelectedCount(PhysGroups) = 0,'Please select a Facility, Surgeon, and Physician Group.',

IF(GetSelectedCount(TopFacility) = 0 And GetSelectedCount(JointSurgeonName) + GetSelectedCount(JointSurgeonNPI) = 1 AND GetSelectedCount(PhysGroups) = 1, 'Plese select a Facility.',

IF(GetSelectedCount(TopFacility) = 0 And GetSelectedCount(JointSurgeonName) + GetSelectedCount(JointSurgeonNPI) = 1 AND GetSelectedCount(PhysGroups) = 0, 'Plese select a Facility and Physician Group.',

IF(GetSelectedCount(TopFacility) = 1 And GetSelectedCount(JointSurgeonName) + GetSelectedCount(JointSurgeonNPI) = 0 AND GetSelectedCount(PhysGroups) = 1,'Please select a Surgeon.',

IF(GetSelectedCount(TopFacility) = 1 And GetSelectedCount(JointSurgeonName) + GetSelectedCount(JointSurgeonNPI) = 0 AND GetSelectedCount(PhysGroups) = 0,'Please select a Surgeon and Physician Group.',

IF(GetSelectedCount(TopFacility) = 1 AND GetSelectedCount(JointSurgeonName) + GetSelectedCount(JointSurgeonNPI) = 1 AND GetSelectedCount(PhysGroups) = 0, 'Please select a Physician Group',

IF(GetSelectedCount(TopFacility) > 1, 'Please select only one Facility',

IF(GetSelectedCount(JointSurgeonName) > 1 OR GetSelectedCount(JointSurgeonNPI) > 1, 'Please select only one Surgeon',

IF(GetSelectedCount(PhysGroups) > 1, 'Please select only one Physician Group'))))))))))

The layout conditional show is:

GetSelectedCount(Facility) = 0 OR GetSelectedCount(JointSurgeonName) = 0 OR GetSelectedCount(JointSurgeonNPI) = 0 OR GetSelectedCount(PhysGroups) = 0

This works correctly.  When i selected mulitple TopFacilty the GetSelectedCount changes to the correct count of selected facilities.

However, once the table

With dimensions JointProcedureType and PhysGroups and the following expression added

Count({1<JointSurgeonName = e(JointSurgeonName), TopFacility = $:: TopFacility, PhysGroups = $:: PhysGroups, JointProcedureType=$::JointProcedureType>}DISTINCT %PatientQVID)

The GetSelectedCount(TopFacility) will show only 1 regardless on the amount of facilities selected. 

Is this a bug or is there something wrong with my expression?  I'm trying to show all Surgeons except the one selected, ignoring everything but the TopFacility, PhysGroups, and JointProcedureType.

1 Solution

Accepted Solutions
NickHoff
Specialist
Specialist
Author

Hey Sunny, didn't see your response.  I was able to figure this out, there is indeed a bug with the current selection.  We've been able to replicate this in multiple apps.  It's in the process of being submitted to Qlik.  However, the work around we are using is to use TopFacility = p(TopFacility) to get the probable where our calculations won't be affected by the

View solution in original post

14 Replies
sunny_talwar

Why would this always be 1?

GetSelectedCount(TopFacility)

I am not completely sure I understand your issue? GetSelectedCount() depends on your selections. If you always have 1 value selected in TopFacility, then it will always be 1. But if you have 0 or more than 1 value selected, why would it be 1?

Would you be able to provide a sample where we can see the issue and what exactly are your concerns

NickHoff
Specialist
Specialist
Author

I wont' be able to share the application complete because the sensitivity of the data.  However, I took some screen shots to illustrate what is occurring:

GetSelectedCount(TopFacility) With No Selections:

getselected count with no selection.png

GetSelectedCount(TopFacility) with one selection prior to meeting the criteria of selecting a surgeon and physician group:

getselected count with one selection.png

GetSelectedCount(TopFacility) with more than one selection prior to meeting the criteria of selecting a surgeon and physician group:


getselected count more than one selection.png

GetSelectedCount(TopFacility) after meeting the criteria and selecting more than one TopFacility:

getselected count after show condition.png

sunny_talwar

Not sure, but how about this?

=If(GetSelectedCount(TopFacility) > 0, Count(DISTINCT TopFacility), 0)

NickHoff
Specialist
Specialist
Author

I was able to get the application scrambled, to reproduce this select horizon for facility, then once the criteria shows select multiple facilities with horizon, the charts should hide however, the top one and the bottom ones data changes and this can't happen. See the attached.

sunny_talwar

I am not seeing this issue

Capture.PNG

Capture.PNG

Regardless of Physician Group, I always see 2 for GetSelectedCount(TopFacility)

NickHoff
Specialist
Specialist
Author

You have to also select a surgeon name, that is part of the criteria to get the charts to display.  Everything works correctly until you get the criteria to show then attempt to select stone crest + horizon or vice versa and/or multiple facilities.

Really what i'm looking for is all the charts to hide if the user selects multiple topfacilties.  If GetSelectedCount(TopFacility) didnt' show one with multiple facilities selected it would work, but I'm thinking there is a bug somewhere.

sunny_talwar

Try this:

=If(GetSelectedCount(TopFacility) > 0, Count(DISTINCT{1<TopFacility = $::TopFacility>} TopFacility), 0)

or

=If(GetPossibleCount(TopFacility) > 0, Count(DISTINCT{1<TopFacility = $::TopFacility>} TopFacility), 0)

NickHoff
Specialist
Specialist
Author

That expression would not help with the data changing on the top and bottom chart when multiple facilities are selected.

sunny_talwar

Can you share a scenario where it won't work?