How to filter all "Male" details first and next followed by "Female"?

Hi All,
Good Evening.

here i have to get the all “male” details


first in excel and next followed by “famale”?

thanks and regards,
hema.G

Hi @Hema_G

Your Steps could be as follows below!

Read range the excel using work book read range

Use filter datatable activity!

Gender =“Male” and save it to a newDt1

Use filter datatable activity!

Gender =“Female” and save it to a newDt2

Write range the newDT1 and append range the newDt2

Regards

HI @Hema_G

Try this expression

(From p in io_TransactionData.Select() where( From q in io_TransactionData.Select() where q(“Gender”).Equals(“Male”)) Select q).ToArray.CopyToDataTable (This will be datatable)

Use write range

Next in Append Range use this as datatable
(From p in io_TransactionData.Select() where( From q in io_TransactionData.Select() where q(“Gender”).Equals(“Female”)) Select q).ToArray.CopyToDataTable

Hope this Helps

Regards
Sudharsan

1 Like

Instead of i0_transaction data you can use your dt

Regards
Sudharsan

The following workflow is the sample with correct expression and will work as per your requirements

Sequence.xaml (5.3 KB)


For Male: dt.AsEnumerable().Where(Function(r) r("Gender").Equals("Male")).CopyToDataTable

For Female: dt.AsEnumerable().Where(Function(r) r("Gender").Equals("Female")).CopyToDataTable

Hope this Helps

Regards
Sudharsan

1 Like

Thank You Sudharsan… :slightly_smiling_face:

1 Like

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