How to transpose datatable?

@SunnyJha

You can follow the steps

  1. Delete the first column as you dont need usign delete data row
  2. Now use generate datatable activity and pass the string as String.Join(",",dt.AsEnumerable.Select(function(x) x(0).ToString)) and select comma as row separator and check the header box
  3. Delete the column which you want as headers also the second one
  4. Now use for loop with loop on all columns dt.Columns
  5. Now inside use add data row and in the arrayrow property pass String.Join(",",dt.AsEnumerable.Select(function(x) x(currentitem.ColumnName).ToString)) and in datatable pass the generated table in step 2

Cheers

1 Like