Merging 2 different datasets

Hello , I have 2 different datasets (normally same amount of rows but not now)
But I don't know how to merge them , couldn't find it online to do it for my specific case. You can see how I tried to do it , and how the object looks with the datasets in it. You can see how they look in the pictures , I want the end to be a dataset with the "valeur" at the end/ last column and the tag (name) next to it.

Extra : I could let the script check for the amount of rows in the first dataset to add an amount of empty rows in the second to make it fit.

Dataset1 :

"#NAMES"
"id","type","numero"
"#TYPES"
"I","str","str"
"#ROWS","7"
"501","Calories","78748290"
"502","Calories","80447923"
"503","ECS","10775395"
"504","Calories","94763"
"505","EFS","5774609"
"506","EFS","5774611"
"507","EFS","5774610"

dataset2:

"#NAMES"
"Tag","Valeur"
"#TYPES"
"str","D"
"#ROWS","6"
"ME-ENER-primaire","0.0"
"ME-DEBI","0.0"
"ME-ENER-primaire1","0.0"
"TestCompteurTag","2700000.0"
"ME-TEMP-depart","2.8693008422851562"
"ME-ENER","0.0"



You need to explain what’s in these datasets, whether or not they have the same column type, and what you expect the resulting merged dataset to look like.

You can't possibly have met the requirements for system.dataset.appendDataset() -- you have different numbers of columns.

I know this , but it tells me it doesn't find the datasets , I know that I need the same rows and other requirements.

Alright done , thanks

Perhaps you could share your input datasets in clipboard form. (Open each dataset in the Ignition dataset editor, and copy to clipboard. Paste that CSV text here, using the "Preformatted text" editor button to make it look neat.)

Alright , done

Those make me think you want to join the two, but there's no common column to use as a key. How are the rows to be aligned?

Wait it would help to have a common column , it would fit perfectly then and in the right order. But right now I can't do this . This is just test tags , other scripts don't find the full aamount of tags yet . Normally it will be correct and the same amount of rows , so it would align right? If the order is correct which is also somthing I need to figure out. Right now I would just like them to be next to each other

They're completely independent? Any number of rows and columns possible?

No the rows will always be the same and the column amounts aswell (they will change, but they will be the same , and the column amount wil never change. I want to make a table with the all the data inside. But to get 1 dataset I had to do alot of scripting and to get the other one also. So now I have 2 datasets that have to be next to eachother/1 big dataset so it can fill the table up

It seems to me they don't belong in the same table. But if one must, I recommend using the DatasetBuilder tool to construct the combined dataset. Where one table is longer than the other, supply nulls for the missing values.

So it's not possible with the append if they are the same lenghts? Would it work if I made a common column in it (not manually)

That .appendDataset() function adds rows, not columns. There are other functions for various possibilities. But to add rows, you need a matching number (and types) of columns. And to add columns, you need a matching number of rows.

Ah alright , I only want to add column so I will just use the other function i guess. My rows will match