OpenRefine: How to create a unique row for each input in a column ( dilneated by comma) - duplicates

I have a bunch of product data to clean prior to entry into a database that looks like this:
COL A
COL B
COL C... "N"
Option 1
A, B, C, D
Option 1 attribute
Option 2
C, D, F
Option 2 attribute
Option 3
D, J, Z
Option 3 attribute
And I'd like for it to look like this with a unique row for every unique product option:
COL A
COL B
COL C... "N"
Option 1
A
Option 1 attribute
Option 1
B
Option 1 attribute
Option 1
C
Option 1 attribute
Option 1
D
Option 1 attribute
Option 2
C
Option 2 attribute
Option 2
D
Option 2 attribute
Option 2
F
Option 2 attribute
Option 3
D
Option 3 attribute
Option 3
J
Option 3 attribute
Option 3
Z
Option 3 attribute
I understand how I could do this with a python script, but I am already using OpenRefine, and I am hoping not to involve a whole new process to my data flow.
Is there an easy way to do this in OpenRefine? I am having a hard time finding a method or extensions for something like this.
Thanks!
EDIT
#magdmartin
How can you fill down blank cells using delineated values from the first cell?
COL A
COL B
COL C... "N"
Option 1
A,B,C,D
Option 1 attribute
Option 1
Option 1 attribute
Option 1
Option 1 attribute
Option 1
Option 1 attribute
Option 2
C,D,F
Option 2 attribute
Option 2
Option 2 attribute
Option 2
Option 2 attribute
Option 3
D,J,Z
Option 3 attribute
Option 3
Option 3 attribute
Option 3
Option 3 attribute
Turned into
COL A
COL B
COL C... "N"
Option 1
A
Option 1 attribute
Option 1
B
Option 1 attribute
Option 1
C
Option 1 attribute
Option 1
D
Option 1 attribute
Option 2
C
Option 2 attribute
Option 2
D
Option 2 attribute
Option 2
F
Option 2 attribute
Option 3
D
Option 3 attribute
Option 3
J
Option 3 attribute
Option 3
Z
Option 3 attribute
Thanks!

I recorded a video here walking through each options describe below here: https://youtu.be/3194zXoJtqI
For this project, you will need to use two OpenRefine functions
Split multi-valued cells on COL B to create one new line for each value separated by comma
Fill down and blank down to fill down the value in the other column from the menu.
If you have a lot of columns you can use the All > Transform to speed up the process with the following expression row.record.cells[columnName].value[0]. The trick here is to fill down Col A last so we can keep the record mode when filling down other column (see screenshot below)

Related

Shared foreign keys without duplication of entries?

Sorry for the beginner question.
I have an Outputs table:
ID
value
0
x
1
y
2
z
And an Inputs table that is linked to the Outputs through the outputsID:
ID
outputsID
name
0
0
A
1
1
B
2
1
C
3
2
B
4
2
C
Assuming that multiple outputs have at least one shared input (in this example outputID 1,3 and 2,4 are the same), is there a way to avoid the duplication of entries in my Inputs table (inputID 3 and 4)?
The 'normal' answer to your question is no. Rows 1 and 2 address output 1, and Rows 3 and 4 address output 2. They aren't duplicates and each reflect something distinct.
So if you are a beginner, I would say you shouldn't want to get rid of these rows.
That said, there are some more advanced techniques. For example, you could have the OutputsID column be an array with multiple values. This is harder, more complex, and non-standard.

Vue frame work how to view my API items 5 in every row

I am using Vue for front-end and I want dynamic show 5 items every row
some thing like that:
1 1 1 1 1
1 1 1 1 1
but when I loop on the array item it show every item in row.
First you need to use non blocking component like label in showing your item, then in the for loop use condition
v-if. Item index % 5 == 0 < br>
or create a div element when condition is meet

Combine multi rows in access - 1 field

I have data in multiple rows, and I need to combine data in similar columns and separate with a semi colon, to end up with one row with grouped by ID.
I have
ID Type
1 A
1 B
1 C
2 D
3 A
3 F
I want results to be
1 A;B;C
2 D
3 A;F
I have limited knowledge of access, but know this should be basic and easy. I appreciate assistance.

Count the whole column that matches your multiple criteria

1 2 3
Attribute 1
Attribute 2
Attribute 3
1. Attribute 1 Attribute 2 Attribute 3 Grade
2. Yes Yes No 1
3. No No Yes 2
4. Yes No No 1
5. No Yes Yes 3
6. No No Yes 2
I want cell B2 to return the number of counted YES in Attribute1 under Grade 1. Is there a COUNTIF formula referencing to multiple columns with condition?
I suspect this is Excel, and the sparse matrix is the desired output format with 1 in B1, if so please try in B2 copied across and down to suit:
=COUNTIFS(INDIRECT($A2);"Yes";Grade;B$1)
Since the location of the data is not mentioned I have used named ranges for convenience and since spaces are not allowed in range names have used underlines instead, so for example, have changed Attribute 1 at the very top to Attribute_1.

Keeping some choices in the Table for the Field of Type Dropdown

i am having a Table named
Attributes
which has
id form_id label size sequence_no Type
1 1 Name 200 1 Text
2 1 Age 150 2 Number
3 1 Address 300 3 Textarea
4 1 Gender 200 4 Dropdown
I am having the doubt how can i keep the Choices of the Field of type "Dropdown" in the Table
Eg. For Gender the choices will Male , Female..
Please give me the suggestions...
You simply need a child table like this:
id value_id sequence_no label
4 100 1 Male
4 101 2 Female
Note where id = 4 is all the values for the #4 question.
Sounds like you're trying to build an automagic form that is built from a database?
I would suggest having that table be something like elements and have another table for options which links back to the original id
i.e.
options
id element_id value text
1 4 1 Male
2 4 2 Female
That way for specific types you will be know to look up the options.
You may want another field to specify if its a multiselect or perhaps you could make it another Type.
edit :
you can add another type to this table call dropdown_choice,
and add all the choices of this dropdown to this table,
need to keep in another field the master id of this dropdown choice.