I have below table name: CustomerContent with the below image data and My product is:
is common in ProductContent cell. First colon no need to split (My product is:
) if next colons we need to split the ProductContent Cell base text assign the values like below. If slip data content CGM
then assign value 37.
CustomerId ProductContent
100 My product is: Shoes
101 My product is: Diabetic Shoes
102 My product is: Shoes Back Brace
103 My product is: Dexcom G6 (CGM)
104 My product is: Freestyle Libre (CGM)
105 My product is: Shoes Knee Brace
106 My product is: Dexcom G6 (CGM): Freestyle Libre (CGM): Diabetic Shoes
107 My product is: Dexcom G6 (CGM): Freestyle Libre (CGM)
108 My product is: Freestyle Libre (CGM): Diabetic Shoes
I need output like below and insert above data into another table name: CustomerContentTemp contain columns CusmerId
and Values
like below format.
CustomerId Values
100 1
101 1
102 8
103 37
104 37
105 14
106 37
106 37
106 1
107 37
107 37
108 37
108 1
From below data logic for inserting into output CustomerContentTemp table
Shoes=1
Diabetic Shoes=1
Shoes Back Brace=8
Dexcom G6 (CGM)=37
Freestyle Libre (CGM)=37
Shoes Knee Brace=14
IF ProductContent cell data is not match then insert value 0.