249
Views
13
Comments
Solved
Sort List
Question

hello community,

how is it possible to sort a list with two different attributes from an aggregate by date?

Many thanks in advance.


2021-05-04 12-43-07
Jeroen Bindels
Solution

Nevermind my previous comment. The NullDate() should work.

Here's an example OML, after publishing it automatically adds some sample rows.

You can look for the way I have solved it, and try to implement it in your application.

If you could provide some more information on the column types of the LatestDueDate in both tables? (I assumed they are Date columns, and entities within the OutSystems database)

TwoDateSort.oml
2023-09-06 07-26-35
Sudip Pal
Solution

I have another approach .


If(Index(Recomendation.LastestDueDate,"1900")=-1,

Recomendation.LastestDate ,

CorrectiveActionRequest.LastestDueDate ) 


Use this .It will work

Thanks & Regards,

Sudip Pal

2025-12-15 09-29-24
Thibaut G

1.make a front-end structure that has all attributes you need from the 2 different tables (1 attribute      for the LatestDueDate)
2.Create a a List variable of that structure in your screen to combine the 2 tables in 1 list.
3. Sort the list by LatestDueDate

Hope this helps 

2025-02-10 17-24-13
Arun Rajput

Hi @Tom Smith 

Yes, it's possible to sort.

If possible share your oml so I can modify it.

Best

Arun

2021-05-04 12-43-07
Jeroen Bindels

Add a calculated attribute to the aggregate, with the following formula:

If(Recommendation.LatestDueDate=NullDate(),CorrectiveActionRequest.LatestDueDate,Recommendation.LatestDueDate)

This combines the dates into one column.

And also point the sorting variable to be able to sort on this attribute.

UserImage.jpg
Tom Smith

thank you, I have tried but it does not work:

2021-05-04 12-43-07
Jeroen Bindels

I think it's an issue with the NullDate() check.

Replace the NullDate() with NewDate(1900,1,1)
That should fix the issue.

I am working on an example module for you, if the above isn't working for you.

UserImage.jpg
Tom Smith

does not work yet. I have also tried other combinations NewDate(1,1,1900) or NewDate(1-1-1900)

2021-05-04 12-43-07
Jeroen Bindels
Solution

Nevermind my previous comment. The NullDate() should work.

Here's an example OML, after publishing it automatically adds some sample rows.

You can look for the way I have solved it, and try to implement it in your application.

If you could provide some more information on the column types of the LatestDueDate in both tables? (I assumed they are Date columns, and entities within the OutSystems database)

TwoDateSort.oml
UserImage.jpg
Tom Smith
2021-06-01 05-56-33
Komal Kumbhar

Hello, 

Its possible to sort with two attributes from the aggregate 

Add following filter in your aggregate 

Recommandation.LatesteDueDate=Nulldate() or Recommandation .LatesteDueDate =SearchVariable (of date type)

Add one more filter and following condition in your aggregate 

CorrectivActionRequest.LatesteDueDate=Nulldate() or CorrectivActionRequest .LatesteDueDate =SearchVariable (of date type)

Hope this Helps,

Komal

2023-09-06 07-26-35
Sudip Pal

Hey Tom,

I am assuming that the data type of LatesteDueDate is "Text".Use the below code in Attribute1 :


If(Recommandation.LatesteDueDate ="01-01-1900",

CorrectivActionRequest .LatesteDueDate,

Recommandation.LatesteDueDate )


This will work.

Thanks & Regards,

Sudip Pal

2023-09-06 07-26-35
Sudip Pal
Solution

I have another approach .


If(Index(Recomendation.LastestDueDate,"1900")=-1,

Recomendation.LastestDate ,

CorrectiveActionRequest.LastestDueDate ) 


Use this .It will work

Thanks & Regards,

Sudip Pal

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