Forum

Duplicate rows base...
 
Notifications
Clear all

Duplicate rows based on count

4 Posts
3 Users
0 Reactions
185 Views
(@alono23)
Posts: 3
Active Member
Topic starter
 

Hi All,

Need your help with converting the original table into the required one (in the attached pic).

Basically i need to duplicate the rows based on the value on the last column. 

Also appreciate if in some magic way i can tell the query to delete the numeric value in one of the Yellow columns, so the result will be unique value in each 

row. hopes it clear. 

Thanks in advance.PQDRs-1.JPG

 
Posted : 03/03/2021 9:31 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Alon,

Welcome to our forum!

Please upload a sample file so we don't have to manually recreate your data in order to help you.

Thanks,

Mynda

 
Posted : 03/03/2021 8:32 pm
(@alono23)
Posts: 3
Active Member
Topic starter
 

Hi, 

Sorry for that. see attached.

Thanks, 

 
Posted : 04/03/2021 7:41 am
(@debaser)
Posts: 836
Member Moderator
 

One way would be:

1. Unpivot the data using the 4 'WK...' columns. (this will add new Attribute and Value columns)

2. Remove the existing Total column.

3. Add a new custom total column that is just =Value

4. Add an Index column

5. Pivot on the Attribute column

6. Remove the Index column.

 
Posted : 04/03/2021 8:12 am
Share: