How to add this type of Queue item

i have a Excel table.

| Customer Name | Customer ID | Job ID | PO Number | Stock | Purchase QTY |
| ------------- | ----------- | ----- - | --------- | ------ | -------- |
| RCB | 123 | 145 | 258147 | 19999 | 1 |
| RCB | 123 | 145 | 258147 | 20303 | 2 |
| RCB | 123 | 145 | 258147 | 9999 | 2 |
| RCB | 123 | 145 | 258147 | 232344 | 1 |
| CSK | 222 | 143 | 12345 | 2222 | 1 |
| CSK | 222 | 143 | 12345 | 1111 | 4 |

Like this for Example.

Now i want add these to queue.
But
i wanna compare the PO Number, if PO Number is same.
Then my queue item should be like
For Example for 1st Queue item, i want the Values like
CustomerName - RCB
Customer ID - 123
Job ID - 145
PO Number - 258147
Stock - 19999,20303,999,232344
Purchase Quantity - 1,2,2,1

and Second Queue item Values should be like
CustomerName - CSK
Customer ID - 222
Job ID - 143
PO Number - 12345
Stock - 2222,1111
Purchase Quantity - 1,4

How to achieve this.
Sample.xlsx (8.7 KB)

Hi @Bhagyaraj_Digumarthi1

You need to perform grouping of data based on Customer Name

You’ll have to Read Range the Excel file into a datatable, then For Each PO Number look for other PO Numbers that are the same, put that data into a dictionary, then pass that dictionary to the Add Queue Item activity.


i tried it, But it is giving me this error.
Here
newrowlist is and list
and queuedictionary is a Dictonary(of String, List)

@Anil_G Would you please help me with this?

@Bhagyaraj_Digumarthi1

Please try this in assign and then you would get an outputdt in required format and can be added to queue inside a for loop

  1. Create an outputdt and use build datatable and create 6 string type columns
  2. Use assign as below
    outputdt = (From d In dt.AsEnumerable Group d By k=d("Customer Name").toString.Trim, k1=d("Customer ID").ToString.Trim, k2=d("Job ID").ToString.Trim,k3=d("PO Number).ToString.Trim Into grp = Group Let g1 = String.Join(",",grp.Select(function(x) x("Stock").ToString)) Let g2 = String.Join(",",grp.Select(function(x) x("Purchase QTY").ToString)) Let ra = New Object(){k,k1,k2,k3,g1,g2)} Select r = outputdt.Rows.Add(ra)).CopyToDataTable

Cheers

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