To assign selective column /

May I ask what went wrong to this activity

I refer to this video for assigning the new datatable for selected column.

My problem assign to value is:
dtinput.DefaultView.ToTable(False,dtinput.Columns(“Date Start”).ColumnName,dtinput.Columns(“Date End”).ColumnName,dtinput.Columns(“grouped sample ID”).ColumnName,dtinput.Columns(“T1a”).ColumnName,dtinput.Columns(“T2a”).ColumnName,dtinput.Columns(“average fineness”).ColumnName,dtinput.Columns(“repeatability”).ColumnName,dtinput.Columns(“FA Number”).ColumnName,dtinput.Columns(“Type”).ColumnName)

I need to select part of data from 2.1 Summary to the template sheet (MU-Rep (output))
in which my target output selected column is:

Thank for helping me cope with this problem.

Workflow:

@Happydayyy
please do not miss to check out also your other Topics, when answers there are in relation with this Topic

checkout that the right variable was used and the DataTable is set and not null

Debugging and Debugging panels will help

we can do it with a much shorter syntax

dtinput.DefaultView.ToTable(False, new String(){"Date  Start","Date End","grouped sample ID","T1a","T2a","average fineness","repeatability","FA Number","Type")

Just pass a String Array with the needed Column Names

Hi @Happydayyy

Try the below syntax:

dt_Target = dt_Input.DefaultView.ToTable(False, New String(){"Date Start", "Date End", "grouped sample ID ", " T1a", "T2a", "average 
fineness ", "repeatability", "FA Number", "Type"})

Attached the excel file too. Check Sheet1 is the expected output from your given excel file.
template looking up (2).xlsx (73.5 KB)

Regards

I still get a mistake here after using the shorten one


Can anyone help me to solve it issue. Many thanks

Hi @Happydayyy

Please use the below query:

targetdt = dtinput.DefaultView.ToTable(False, New String(){"Date Start", "Date End", "grouped sample ID ", " T1a", "T2a", "average fineness ", "repeatability", "FA Number", "Type"})

Regards


still hv error…

Hi bro remove that targetdt = from that query @Happydayyy

dtinput.DefaultView.ToTable(False, New String(){"Date Start", "Date End", "grouped sample ID ", " T1a", "T2a", "average fineness ", "repeatability", "FA Number", "Type"})

Regards


but in the ‘’ sheet, the average
fineness is exist.

HI @Happydayyy

try now

dtinput.DefaultView.ToTable(False, New String(){"Date Start", "Date End", "grouped sample ID ", " T1a", "T2a", "average 
fineness ", "repeatability", "FA Number", "Type"})

Regards

1 Like

Thank you very much for this query.
However i faced another issue for this robot


May I ask how i can solve it?

HI @Happydayyy

You are using the excel application scope right. So, you can directly use the write range (excel activity).

Use the below activity instead of write range workbook.

image

Don’t forgt to mark the add headers in properties panel as true.

Regards

Actually I am following her video in spilting data to multiple sheet based on “Type”. It’s ok to spilt out multiple sheet?
For example, one sheet is for ‘Type (4N)’ and paste all column data for 4N;one sheet is for ‘Type (3N)’ and paste all column data for 3N

This robot i combined these two video for reference. now the datatable part is solved but i still coping with the spilting excel sheet part.

Hi @Happydayyy

Yes you can split the sheets as per your requirement.

Have your above query resolved?

Regards

It’s only can output sheet 1 without spilting data based on …

How can I set something to spilt multiple sheet (i…) based on “Type” ?

@Happydayyy
we support you on your several topics, but also encounter, that these topics are not straightforward handled in flow

  • topic creation - use case description
  • clearing of requirements, if needed
  • solving
  • topic closing

We also prefer to scope 1 topic = 1 case. This strict pattern helps other reasearchers faster to find solutions for similiar cases

initial this topic was about: shortening a data table on a subset of columns

with:

a new case is inserted in this topic, where we prefer to open a separate topic for this and not mismatching it with the origin topic

Thanks for your support

Solution approach preview for:

1 Like

Okay refer to About spliting the excel sheet based on different types of data
This post now. Thanks all so much

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.