1 Reply Latest reply on Jun 5, 2015 4:25 PM by diego.medrano

    How to pivot data from redshift live connection/extract?

    haoyuan jang

      Hi

      The use case is that I have a table looking like
      ID, type, blah blah blah

      for each set of data I have ( or for each table that looks like this ) there is a unique set of values type column can take. Im looking for a way to generate table that looks like

      type1, type2, type3

      without me having to create new measures each time. Currently the way Im doing it is to create count condition for each type
      e.g if type = 'type1' then 1 else 0 end
      I dont want to do this for every single set of data since there are a lot of them.

       

      An example here to make things clearer....

      ID type

      1 harry

      2 potter

      3 harry

      4 john

      5 snow

      6 nothing

      7 nothing

      I want this to be converted to

      harry | potter | john | snow | nothing

         2    |     1    |    1   |     1   |       2

       

      I found some training videos that talks about how to unpivot columns in an excel sheet with data interpreter. Didnt seem to be able to find any resources on how to do that for redshift connection. In my case, the data set is quite huge and thus not quite feasible to export as excel and go from there.

       

      So... Is there anyway to do what I want in tableau?

      Thank you so much!

       

      And btw I know tableau customer support is usually quite spot on... I cant be reached via email used to register this account right now... If you need additional information, just ask in thread