Forum Discussion

mitchpj75's avatar
mitchpj75
Helper I
5 years ago
Solved

Pivoting to get the correct data format for visuals

Hi,

 

Struggling with the right format of my data.  I have 2 tables (case values and case value attributes).  The case values are the names of the fields and the case value attributes are the values. I need to know the names of the fields to know what the values refer to so I have merged them.

 

Which gives me a table like this

case idcase attribute IDCase attibute name (database name)Field nameValue
13364NYP_HIH_001Type of referralCSE
13365NYP_HIH_002Ref assessmentHigh
13366NYP_HIH_003Date of referral1/11/2020
13367NYP_HIH_004Intial contact date05/11/2020

 

What I really want is the format below - classic excel format of col headers and data underneath, where the field name is the column header and its value underneath...i can delete the columns I dont need but the format is hard to achieve...

 

case idType of referralRef assessmentDate of referralInitial contact date
1CSEHigh01/11/202005/11/2020

 

I have lots of calcs to do between columns to form number of days taken, average days to do x, column x plus Column Y - Column Z etc etc etc and this classic excel format seems the best way to do it as all the data is then in one table as well (hence why I merged them at the beginning.

 

I have been trying the pivot table function in the Transform tab but end up with this

 

case idcase attribute idType of referralRef assessmentDate of referralInitial contact date
13364CSE000
133650High00
133660001/11/20200
1336700005/11/2020

 

But this doesnt work for calcutaing number of days between date of referral and initial contact date is showing as 0 for the case 1 as as no value.

Any advice on how best to do the pivot or to get the data in the format I require? Thanks in advance for any advice!

  • Remove the 2 columns 

    case attribute ID Case attibute name

    before the Pivot.

    Then Pivot on the Field Name, using Value as value.  Choose 'Don't aggregate' from advanced.

     

     

2 Replies

  • HotChilli's avatar
    HotChilli
    Community Champion

    Remove the 2 columns 

    case attribute ID Case attibute name

    before the Pivot.

    Then Pivot on the Field Name, using Value as value.  Choose 'Don't aggregate' from advanced.

     

     

    • mitchpj75's avatar
      mitchpj75
      Helper I

      Awesome!  This worked very well...I see what I should have done to complete it.  Thanks!  Have given kudos!