Interview Usecase Scenario

Hello All,

The image is a table listing various fruits, their associated activity IDs, and their respective dates of completion. (Captioned by AI)
Case 1: I need to fetch all the fruit count without hardcoding the value. Eg: Orange =3, Banana=4

Case 2: I need fetch the past and future date.

How it can be achieved?

@sharu_priya,

Don’t want to spoil your learning adventure so just giving you the pointers.

This would be achieved with LINQ Groupby

Use LINQ to filter data based on Date of completion

Thanks,
Ashok :slight_smile:

1 Like

Thank you so much for the pointers.

Will try to complete it and let you know.

1 Like

Partially i am getting the solution.
My input file is:
A table lists various activities completed by different fruits with columns for Name, Activity ID, and Date of Completion. (Captioned by AI)
But while debugging, the input in the local panel seems different.
A screenshot displays a "Local Value" window showing tabular data with columns for Name, Activity ID, Date of Completion, and several empty columns (Column1, Column2, Column3). (Captioned by AI)

So i am getting the output as:

Can you please help me??
GroupByCount.xaml (8.2 KB)
AA Usecase.xlsx (9.9 KB)

@sharu_priya,

Follow these steps.

  1. Build Result data table like this using Build Datatable activity
    The image shows a "Build Data Table" activity window from a software application, with a data table that has two columns: "Name" (String) and "Counter" (Int32). (Captioned by AI)

2.Use this LINQ in Assign activity

(From row In dtInput.AsEnumerable() Group row By name = row("Name").ToString() Into Group Select dtResult.Rows.Add(name, Group.Count())).CopyToDataTable

This image shows an assignment operation in UiPath that creates a new DataTable () by grouping rows from  by the "Name" column and counting the occurrences. (Captioned by AI)

Output:
image

Thank you so much. It Worked

1 Like

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