Forum Discussion

anshpalash's avatar
anshpalash
Helper II
4 years ago
Solved

Duplicate each row 2 times

Hi all,

I have a dataset in the form:

CodeDuplicate Number
Manual 2
Camera2
123 - Data2

 

I want to duplicate each row two times so that I get output in the format:

Code
Manual 
Manual 
Camera
Camera
123 - Data
123 - Data

 

To achieve the output, I created a custom column using:  List.Repeat([Code],[Duplicate Number])

 

However, I am getting an error: We cannot convert the value "Manual" to type List.

Can someone please advise on how to achieve the output I am trying to get?

 

  • Hi anshpalash ,

     

    You could add a new custom column with the following code:

    {1..2}

     

    This should give you an expandable list column that you can 'Expand to New Rows'.

     

    Pete

2 Replies

  • Hi anshpalash ,

     

    You could add a new custom column with the following code:

    {1..2}

     

    This should give you an expandable list column that you can 'Expand to New Rows'.

     

    Pete