Count variables

image

Hi guys ,
i want to count the dates and write in other cell how much it got dublicated
PS: those days are dynamic so they are variables ( i want to count the varibales as is if exists )
thanks in advance

@omarmohamed93

Assign your new DT=(From p in dt.Select() where( From q in dt.Select() where string.Join(",",q.ItemArray).Equals(string.Join(",",p.ItemArray)) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()

Replace the dt with your datatable.

If you want count

Int countdt=newdt.rows.count

Thanks,
Aman.

Hello @omarmohamed93

You can use the below custom activity to quickly generate the count of each date in the datatable.

Use the datatable consolidate activity. User guide is attached in the component itself

its not working with me
can you make a xaml file for me ?

–use excel application scope and pass the file path as input
–use read range and get the output as a variable named out_dt of type datatable
–then use a for each row loop and pass the above variable as input to the loop
–inside the for each row loop use a IF condition and mention the condition you want
like this
row(“Columnname”).ToString.Contains(“keyword you want to search”)
if this condition gets passed it will go to THEN part of if condition
inside the THEN part use a assign activity to increment a variable count_row of type int32 declared in variable panel of default value 0, like this
count_row = count_row+1

finally this count_row will give us the count of rows which has the keyword

1 Like

@omarmohamed93

Please find the xaml for your reference

FindDuplicates.zip (16.8 KB)

Hope this helps!!!

Thanks,
Aman Sheik.

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