Datatable task

I have a datatable like this
image

I need it as this
Data in single now
image

In next transaction also I will be getting datatable shown in pic1
Again I will be getting the datatable
eg:
image

Then the final consolidated output must be like this

image

I need all particular transaction in single row…

Please Help…

@Sweety_Girl Is there a way to have a more standardized result datatable, or does it have to be flexible?

If you can make a standardized one, it will be a lot easier. Using Rollno1 as an example, you can easily assign the row number data from the individual person to the corresponding column number in the final datable (similar to transposing data from rows to columns). Same for the Empno1 data. With a fixed results table, you will also know which column number to assign the ‘data’ figures. The only downside to this is that you will likely have several completely blank columns (say, for example, if you created a fixed results table with ‘Name’, 5 ‘Rollno’ columns, 5 ‘EmpNo’ columns + the ‘data’ column on the end).

If you do need a flexible final datatable. You will need to incorporate a few activities to look into every person’s datatable you receive and determine what the likely maximum row numbers are for ‘Rollno’ and ‘Empno’ (the maximum number of rows will be three for both, using the above example). Once the maximum row numbers are determined, this will equal the number of columns you will need add/build into the final datatable (‘Name’, 3 for each + the ‘data’ column (8 columns total)), and from which you can assign the row data to the corresponding column numbers, including blank data.

I hope the above makes sense.

2 Likes

@Sweety_Girl

In cases of we do feel that we have to append dynamicly columns for representing the data structure we do have a strong trigger that we are not working within the right schema. Appending columns in a dynamic way will result into a never fixed form.

A modified Key Value schema can help for getting such scenario under control

Let us think on the columns: Key | Value | Index for a structure. It will allows to reflect all the cases:

Key | Value | Index | GroupID
Name | Emmi | 1 | Emmi
Rollno | 234 | 1| Emmi
Rollno | 456 | 2 | Emmi
EmpNo | 789 | 1 | Emmi
EmpNo | 678 | 2 | Emmi
EmpNo | 906 | 3 | Emmi
data | 445 | 1 | Emmi

So we can parse the data into this intermediate structure. From this structure we als can generate this the final not fixed column structure on adhoc base.

2 Likes