55
Views
4
Comments
Solved
GroupBy a field and add new attribute to get the latest date
Question

I have a TableRecord where I show different course details which has fields like CourseId, CourseName, Session and StartDate. I want to GroupBy using CourseID and CourseName and add a new Attribute say 'New_Date' to show the most past date amoung the startdate for each group.

My aggregate is showing something like this

IdCourseIDCourseNameSessionStartDate
11AndroidDecember01-12-2019
22iOSJanuary03-01-2020
34OutsystemsMarch01-03-2019
41AndroidJanuary01-01-2020
52iOSSeptember03-09-2019
64OutsystemsFebruary01-02-2019



I want this to look like the following

IdCourseIDNew_StartDateCourseNameSessionStartDate
1101-12-2019AndroidDecember01-12-2019
January01-01-2020
3201-02-2019OutsystemsMarch01-03-2019
February01-02-2019
5303-09-2019iOSSeptember03-09-2019
January03-01-2020


 Thanks 

2016-04-22 00-29-45
Nuno Reis
 
MVP
Solution

Hello Sundeep.

Your aggregate will be something like this.


Can you try?

UserImage.jpg
Sundeep S

Nuno Reis wrote:

Hello Sundeep.

Your aggregate will be something like this.


Can you try?


Hi Nuno,

In the StartDateMin field, which date should I select? Is that of the entity?  Can you please provide a screenshot of the field selection?


From which folder here should I select the StartDate? 

When I select the StartDate from GetCourseData aggregate as StartDateMin value, I am getting the default date 01-01-1900 00:00:00


2016-04-22 00-29-45
Nuno Reis
 
MVP

I assumed you already had an entity with the data.

After placing the entity Course in aggregate, I simply right-clicked Id and picked Min, right-clicked COurseId and picked Group By and so on.

UserImage.jpg
Sundeep S

Nuno Reis wrote:

I assumed you already had an entity with the data.

After placing the entity Course in aggregate, I simply right-clicked Id and picked Min, right-clicked COurseId and picked Group By and so on.

It worked.
Thanks Nuno. 

The only issue was that I added a new attribute and then selected the StartDate from aggregate. I right clicked the StartDate in the aggregate and selected Min. Its working fine now.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.