hello community,
how is it possible to sort a list with two different attributes from an aggregate by date?
Many thanks in advance.
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)
I have another approach .
If(Index(Recomendation.LastestDueDate,"1900")=-1,
Recomendation.LastestDate ,
CorrectiveActionRequest.LastestDueDate )
Use this .It will work
Thanks & Regards,
Sudip Pal
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 LatestDueDateHope this helps
Hi @Tom Smith
Yes, it's possible to sort.
If possible share your oml so I can modify it.
Best
Arun
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.
thank you, I have tried but it does not work:
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.
does not work yet. I have also tried other combinations NewDate(1,1,1900) or NewDate(1-1-1900)
Thank you very much for your help.
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
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.
Have a great day!