Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kmstephenson
Creator
Creator

input box for bubble chart

Hi All,

I am attempting to add an input box to allow the user to restrict a chart to only show clinics with a certain number of patients (i.e. 10 or more patients, 20 or more, 100 or more, 1000 or more, etc.). The chart I will be using the input box for is a scatter chart with the following dimension and expressions:

- clinic name, pcp_practice_last_knwn_desc, as the only dimension

- hcc score, hcc_c_v22_commun, as the first expression (x-axis)

- number of ED visits, ed_cnt, as the second expression (y-axis)

- total number of patients for the current selection, count(distinct patient_id), as the third expression (bubble size)

The field patient_count (total number of patients per clinic) is available.

Given patient_count is not a dimension or expression, what is the recommended method of restricting the table to only display clinics with a certain number of patients (and to let the user select the minimum number of patients per clinic for display)?

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

Hi there,  just rereading your post.  I believe you would want the condition on the dimension (as a calculated dimension) so that you only show clinics that match the condition. On the dimension aggr() tends to work well. Try the following and post an example if you are having issues.  Ensure the 'suppress null values' is turned on on the dimension tab for your dimension.

if(   aggr(  count( distinct patient_id), pcp_practice_last_knwn_desc) >= $(YOURVARIABLE) , pcp_practice_last_knwn_desc)

View solution in original post

5 Replies
JonnyPoole
Employee
Employee

This will check if the subtotal of the patient count per clinic is greater than the variable captured by your input box and conditionally show the number or assign a NULL (which will be suppressed from the chart by default). 

if ( count( total <pcp_practice_last_knwn_desc> distinct patient_id)  >=  $(YOURVARIABLE) ,  count( total <pcp_practice_last_knwn_desc> distinct patient_id) )

kmstephenson
Creator
Creator
Author

Hi Jonathan,
Can you please further explain what the above expression would be used for?

Thank you!

JonnyPoole
Employee
Employee

You would use the if clause in each condition to check if the total patients in a clinic was greater than the user inputted threshold.  The syntax above may not work 'as is' in your QVW.  I can tweak it if you have some sample data or qvw to share. 

kmstephenson
Creator
Creator
Author

Hi Jonathan,

Sorry I was out of the office last week and just now able to review this. Is your suggestion above something that would be included as a conditional for the dimension? Where do you recommend using the IF clause?

Thank you!

JonnyPoole
Employee
Employee

Hi there,  just rereading your post.  I believe you would want the condition on the dimension (as a calculated dimension) so that you only show clinics that match the condition. On the dimension aggr() tends to work well. Try the following and post an example if you are having issues.  Ensure the 'suppress null values' is turned on on the dimension tab for your dimension.

if(   aggr(  count( distinct patient_id), pcp_practice_last_knwn_desc) >= $(YOURVARIABLE) , pcp_practice_last_knwn_desc)