how to group same values in excel
need all apples in separate sheet, similary orange banana etc…
the thing is the column value keeps on changing with each excel.
next excel can be
How to achieve this without for looping??
Try like this:
applet = DatatableName.Select(“Col1 = ‘apple’”).CopyToDataTable
But “apple” is not fixed… it keeps on changing
I am not sure I got you in all.
And the expected result is a new excel with:
Rows: Row1, Col1 =peach, Row2, Col1 =peach, Row3, Col1 =peach
Rows: Row1, Col1 =strawberry, Row2, Col1 =strawberry
Is this your requirement?
Yes, but the fruit name keeps on changing…sometimes it can be watermelon that is having 10 info…so need to create a sheet for watermelon and put all watermelon in that sheet.
Even if the data is one it should be segregated and placed into a new sheet with its name.
i developed this by using for loop and filter data table activity…But its very time consuming.
Give a try:
readin excel in a datatable (Read Range)
Create a list from distinct fruit names (LINQ/DataSetExtensions Distinct Method helps for this)
Iterate over the list with distinct fruit names
inside the iteration:
- use fruitname to collect all information for this fruitname
- write these information back in a new worksheet
Try this if the value is changing
Here Value is a string variable, you can pass your filter value
In the case of you need some further help then please also post for 2 scenarios an input sample and an output sample (e.g. *.xlsx) along with your question.
Upload.xlsx (12.6 KB)
Hi, here is the input file. Sorry for the late reply.
But this +value+ is not fixed. So need to include the for loop item as +value+ ??