# Issue creating dataset

**URL:** <https://forum.inductiveautomation.com/t/issue-creating-dataset/66984>\
**Category:** Ignition\
**Created:** [November 28, 2022, 4:17pm UTC](https://forum.inductiveautomation.com/t/issue-creating-dataset/66984 "2022-11-28T16:17:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sharan](https://forum.inductiveautomation.com/u/sharan)\
**Post date:** [November 28, 2022, 4:17pm UTC](https://forum.inductiveautomation.com/t/issue-creating-dataset/66984/1 "2022-11-28T16:17:10Z")

</div>

ds = system.dataset.toDataSet(['Bin\_No','Actual','Target'], [stringArray,TargetArray,ActualArray])   
event.source.templateParams = ds

This creates a dataset of 3 columns- 'Bin\_No','Actual','Target'.  
But the problem here is, the data from StringArray is written as a row, whereas I need it to be written as a column,  
NOW -  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/f/ef3295f3472465b297f1b99dac4938aff7366db1.png)  
How can I get the data in column format ??  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/a/9a0cb7ff63dd7459e7263e21ee08d1e20bbb33dd.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 28, 2022, 4:28pm UTC](https://forum.inductiveautomation.com/t/issue-creating-dataset/66984/2 "2022-11-28T16:28:37Z")

</div>

The second argument to `toDataSet` is expected to a be a _list_ of _lists_, in a format like this:

```auto
[
  [R1C1, R1C2, ...],
  [R2C1, R2C2, ...],
  ...
]

```

You will need to add code to 'pivot' your three lists of values. Python's builtin `zip` function may be useful to you.

---

<div class="post-metadata">

**Author:** ![sharan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sharan](https://forum.inductiveautomation.com/u/sharan)\
**Post date:** [November 28, 2022, 5:15pm UTC](https://forum.inductiveautomation.com/t/issue-creating-dataset/66984/3 "2022-11-28T17:15:41Z")

</div>

Thanks @paul-griffith  
The zip function on the second argument did the job.
