Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
I would like to pass a value from a user defined list box of the dashbouard to a variable definition in order to avoid designing multiple charts with only one parameter different. For example, I have a variable defined as count({$<Metric={1}, Intervention={0} >}HospitalAccountID), I hope I can pass different values obtained from list in the dashboard to Metrics such as CXR, Readmission, orderSet. In this way, I only need ONE chart instead of THREE charts on the dashboard.
Is this passible? Thanks
Longmatch.
Yep, got it.
There are 2 ways of doing this:
Detail for option 2:
Assuming you have a field called [Metric Option] in the data model (most likely a data island), create a variable, vExpression, with the following value:
='Count({' & Chr(36) & '<' & Only([Metric Option] & '={1}, Intervention={0}>} HospitalAccountID)'
Then, in the chart expression, use $(vExpression)
There may be a typo in the above - I haven't tested it.
Jason
What version of QV are you using?
Are you saying that based on a user-selection you want your expression to change e.g.
count({$<Metric={CXR value}, Intervention={0} >}HospitalAccountID)
count({$<Metric={Readmission alue}, Intervention={0} >}HospitalAccountID)
count({$<Metric={Orderset value}, Intervention={0} >}HospitalAccountID)
?
Thank you very much for your quick response.
I am using QV 11.
CXR, readmission and Orderset are from different columns in the database. What I really want is to replace Metrics with the value from dashboard such as CXR, readmission and orderset. Right now I am using count({$<CXR={1}, Intervention={0} >}HospitalAccountID) for CXR chart, I do not want to create another two charts for readmission and orderset. I am hoping I stated my questions clearly this time. Thanks
I think I might be able to create a new variable named selectedMetrics to link its value to a listbox created by inline coding and replace Metrics in the expression with this variable. Is this the correct approach? Thanks.
Yep, got it.
There are 2 ways of doing this:
Detail for option 2:
Assuming you have a field called [Metric Option] in the data model (most likely a data island), create a variable, vExpression, with the following value:
='Count({' & Chr(36) & '<' & Only([Metric Option] & '={1}, Intervention={0}>} HospitalAccountID)'
Then, in the chart expression, use $(vExpression)
There may be a typo in the above - I haven't tested it.
Jason
I will test the number 2 option later today.
Conditional show feature introduced in v11 is the feature I wanted to use but don't know how. Is there any tutorial or instructions how to use this wonderful new feature? Thanks.
It's really simple. Create the different expressions as normal. Then tick the "Conditional box" and enter a boolean expression. When the result of this expression is TRUE, the expression will display in the chart.
e.g.
Expression = count({$<CXR={1}, Intervention={0} >}HospitalAccountID)
Condition = Only([Metric Option]) = 'CXR'
Hope this helps,
Jason
Thank you very much for your helps. My problem has been solved under your help. To make my dashboard more robust, I wanted to pass the value selected from listbox to the variable definition - the original question. I defined a variable v_testVariable as =sum(CXR), and it works fine. I would like to change the definition to =sum(only[%Metrics option]), it does not work even I selected CXR was selected. Any suggestions? Thanks
Can you post a sample of your app?
Here is my sample. What I wanted to do it to replace CXR in expression definition, variable definition, chart title and legend with the item selected in Metrics listbox. In this way, I do not need create individual chart for each metrics. It will save a lot of dashboard space and it will be more efficient. Thanks