11 Replies Latest reply: Nov 20, 2014 4:02 PM by mark casselman RSS

    single bar chart to include bars of multiple indicator variables

    Kristina Stephenson

      I have a wide dataset that includes many chronic condition indicators, and I want to see all of these on the same bar chart.

      For example:


      Patient_ID        Start_Dt          End_Dt            chf_ind    copd_ind     diabetes_ind        ckd_ind     ..... etc

              1                 1/1/2012      12/31/2012            1             0                        0                         0

              2                 1/1/2012      12/31/2012            0             0                        1                         1

              3                 1/1/2012      12/31/2012            1             1                        1                         1


      What I did is keep this dataset with all indicator variables as the fact table and then transposed the data into 1 row per patient per time frame per condition (indicator variable=1).


      For, example:


      Patient_ID      Start_Dt          End_Dt           condition

              1             1/1/2012        12/31/2012          CHF

              2             1/1/2012         12/31/2012         DIABETES

              2             1/1/2012         12/31/2012         CKD

              3             1/1/2012         12/31/2012         CHF

              3             1/1/2012         12/31/2012         COPD

              3             1/1/2012         12/31/2012         DIABETES



      I used the transposed variable condition for the bar chart to be able to see in descending order the frequency of conditions. However, if I select any condition within the bar chart, it does not show me what other conditions these patients have. For example, I want to be able to select the CHF bar and see that of patients with CHF, the other coexisting conditions they have are COPD and DIABETES. I had to create listboxes and buttons to select the indicator variable from the fact table to update the bar chart with this information.

      Do you have any recommendations for another way of doing this? Where you have a number of indicator variables that you want to see on the same chart like this?

      Thank you!