How to get compare the datatable with another datatable,if the value specific value is not available

I have a Table like Top country Table1:
Top Country.xlsx (10.8 KB)
In this “Seychelles” value is not available in the Table2:
All Country.xlsx (5.3 KB)
Here i need to write a Compared data with Column “Session” Value in Table2 and clomun “Country” value in Table1 in another Datatable Table3 with “Seychelles” ="-".

Can any one help…

Hi @keerthi_arumugam ,

You can do it in nested each datarow loop

First for each data row take the Top Country. Inside open another for each datarow for "All Country:. Then match the values. If it matches enter the same value else assign “-”

Can you Provide a flow…

looks like the same case

Yes,i already tried not get any solution

what had you done so far?

I have copy the linkq query and paste into my wrokflow with my datatable name ans using write range write a dtTarget but not working for me.

maybe you can hare the xaml with us

sure
TopCountry Extraction.xaml (8.6 KB)

Having a error in Assign Activity

You can try the below workflow.

CompareData.xaml (11.8 KB)

1 Like

yes, i have tried but i need to print the all the countries in Top country with order and column “session” and if the unmatched country appear in the list make as “-” and continue with another country so on…
Capture11

Hi,

You can try this.

Output will be look like

Country Session
United States 1540
China 32
United Kingdom 97
Germany 33
Netherlands 150
Seychelles -
Australia 6
Canada 85

CompareData.xaml (17.2 KB)

1 Like

yes,Now its Working Find for me…Thank you

1 Like

Please mark it as Solution. Thanks.

1 Like

Hi @manjula_rajendran I’m facing error while running a bot, if the all the Countries are matches in All Country Table and Top country Table means i need to write a Country as it is.
Error1

Hi @keerthi_arumugam ,

I hope you have not changed anything from the workflow which i gave you. If so, please remove the assign dtTemp activity before the For Each Loop.

Row variable is getting wrong ,which we insert the before for each means

Hi @keerthi_arumugam , you don’t need that dtTemp. I just kept for my reference. Our work only in For Each Loop.

Previous week wise Traffic new.xaml (19.8 KB)
In this, i have remove a dtTemp assign activity but its getting error.
Analytics www.changepond.com Location 20210622-20210628.xlsx (10.6 KB)
Analytics www.changepond.com Location 20210730-20210805 (1).xlsx (9.5 KB)
In these file all the Countries are matches,i need to write as it is with appropriate counties and if they not matches means retruns “-” with appropriate countries

The main mistake in your flow is, inside For Each Loop you should have the dtTemp. That is the main filter.

dtTemp = dtAllCountry.AsEnumerable.Where(Function(r) r(“Country”).ToString.Trim.ToUpper = row(“Country”).ToString.Trim.ToUpper).CopyToDataTable

After this Add Data Row.

I’m not able to attach the workflow here. So created the new post.

Find the solution there