Excel activities11

In an excel sheet having 20000 employees data
So in that I have to process unique employee id say for example 089652 having 10 rows I have to take out the unique employees id to a data table… Give me fine Sol for this …

@prasssaadd,

Use “Excel Application Scope” and “Read Range” activity to read the excel as a datatable since it has more number of rows.

Then use filter datatable and for that ID column filter with the required value.

1 Like

One way you can do this is to use the Excel Application Scope Activity to use the Read Range Activity and export the DataTable to a variable (we’ll call it ExcelDT).

From here, using the Assign Activity, you can do the following:
ExcelDT = ExcelDT.DefaultView.ToTable(true, "<col1>", "<col2>", ...)

where <col1>, <col2>, etc are the columns you want included in the final DataTable.

Note: Assigning the new DataTable to the same variable will overwrite the previous DataTable, if you will need to access that information again in the future, you should create a new temp DataTable variable to assign the filtered DataTables to.


Example Dataset:
[ID] [food]
1 pizza
2 hot dog
1 hot dog
2 pizza
1 pizza
1 cheeseburger
2 hot dog

Example One:
ExcelDT = ExcelDT.DefaultView.ToTable(true, "ID")
Output Dataset:
[ID]
1
2

Example Two:
ExcelDT = ExcelDT.DefaultView.ToTable(true, "ID", "food")
Output Dataset:
[ID] [food]
1 pizza
2 hot dog
1 hot dog
2 pizza
1 cheeseburger


In the first example, since we only selected the first column ID, the returned DataTable returned ONLY the unique items from that column.

In the second example, we selected the first column ID AND the second column food. The new DataTable as a result returned any and all UNIQUE combinations of those two columns, this is why we see repeats in both ID and food.

1 Like

So after extracting the unique data… How we can construct a queue for this unique data

So …in that case if I want food as hot dog only… And construct a queue for this unique data… How?

@prasssaadd,

By using For Each Row activity with the filtered datatable, for each row you can add it into the Queue as a DataRow item. Then you can use it as datarow.

It came like this

@prasssaadd,

Check this xaml, I have looped a datatable and added each row as an queueitem in a Queue.

You need to change the datatable name, Queuename.
DataTableToQueue.xaml (5.6 KB)

Thank you @sa[date=2019-10-30 timezone=“Asia/Calcutta”]:expressionless:

Blockquote

Thank you @sarathi125

1 Like

Mark the post resolved if it is resolved your issue.

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