banjanxed
banjanxed

Reputation: 73

How to facet multiple columns in Google Refine

I have a data set with 30 columns and multiple rows (some cells have no data). I would like to be able to facet the columns in groups.

     1 2 3 4...
Row1 A B C D
Row2 E A D F
Row3 Q A B H  

Given the above data I would like the facet to retun the number of instances in a group of columns. For the first three columns I need the facet to return:

A - 3  
B - 2  
C - 1  
D - 1   
E - 1  
Q - 1 

I have tried to combine columns when I loaded the data but the individual data was grouped as well. This is not the desired outcome. For example:

ABC - 1  
EAD - 1  
QAB - 1

Thanks in advance.

Upvotes: 4

Views: 4184

Answers (2)

magdmartin
magdmartin

Reputation: 1787

Did you tried to transpose all your column in one and facet on this 'master column'?

When transposing add the column name so you know from where the data comes from. The you can split your master column into 'source column' and 'data'.

You can find here the JSON code to transpose a large amount of column: http://googlerefine.blogspot.ca/2011/09/json-code-to-transpose-important-number.html

it should work for your project with a limited amount of edits.

Hope it help!

Upvotes: 2

A5C1D2H2I1M1N2O1R2T1
A5C1D2H2I1M1N2O1R2T1

Reputation: 193527

I can't think of a more efficient way to do this off the top of my head, but you can do a custom facet with something like:

[ cells.["1"].value, cells.["2"].value, cells.["3"].value ]

where "1", "2", and "3" are the names of your columns. If your column names are single words, like "V1", "V2", "V3", and so on, you can also change the custom facet to something like:

[ cells.V1.value, cells.V2.value, cells.V3.value ]

With a lot of columns, this solution might be somewhat tedious though...

Upvotes: 2

Related Questions