4 Replies Latest reply on Jul 1, 2013 7:25 AM by trent.fowler@hci.utah.edu

    Charting by Many Fields

    trent.fowler@hci.utah.edu

      Title

      Charting by Many Fields

      Post

           I have a database of patients that I would like to make a few charts from. I would like to chart counts of the patient's ethnicity data, but also have that data split by their gender in a column graph. Any suggestions on how to do this?

            

           For Eaxmple:

           20 Caucasian Patients: 12 Males, 8 Females

           10 African American: 3 Males, 7 Females

            

           Thanks! 

        • 1. Re: Charting by Many Fields
          philmodjunk

               It's all possible, but how is your table structured? and what kind of chart? Will this be a chart of all the records in a found set (all the records pulled up by performing a find)?

          • 2. Re: Charting by Many Fields
            trent.fowler@hci.utah.edu

                 I have a patient's table that contains records of individual patients. Both of the fields that I would like to chart (column graph or stacked bar) gender and ethnicity are fields in this table. It would be great to chart just the found set.

                  

                 eg.

            Name              Gender      Race/Ethnicity

                 Jane Doe       Female      Caucasian

                 John Smith    Male           Caucasian

                 Jose Perez    Male           Hispanic

                  

                 The other tables are not useful for this task (contact tracking, inventory items)

            • 3. Re: Charting by Many Fields
              philmodjunk

                   For a simple barchart, what you chart for your Y-axis data series is actually a summary field with the "count of" setting set to count some field in the table that is never empty of data for any of the records being counted. In your data source settings, you'd specify grouped records. The trick is to be able to group your records into gender/ethnicity groups by sorting on a single field. This requires a calculation field such as:

                   Left ( Gender ; 1 ) & Ethnicity

                   To combine the two values in a single field.

                   For stacked bar charts you need Four fields, one pair to count male patients and one to count female:

                   cMaleFlag: Gender = "Male"
                   cFemaleFlag: Gender = "Female"

                   Then you set up and chart two summary fields, one to compute the total of cMaleFlag and one to compute the total of cFemaleFlag. And you'd just sort your records by Ethnicity. And you'd have two y-axis data series: one for each summary field.

              • 4. Re: Charting by Many Fields
                trent.fowler@hci.utah.edu

                     Worked Perfectly, thank you!