Sort dataview by Decreasing Date

Brendan Broughton
Brendan Broughton Active Partner
Third Anniversary 100 Comments 100 Up Votes 25 Likes
edited April 2020 in Platform

Before I go to too much trouble building in a workaround I thought I'd see if anyone in the Community has found an simple way to Sort a dataview by decreasing date.

 

Below is the issue you get in BOARD when you try to sort on the Day Entity as a block..  The issue is that it doesn't actually sort it as a 'date', but more as a text/numeric field by just sorting character by character (meaning 3rd to 9th will come before 29th).

 

Find()/Day()/Month()/Year() don't work in DV algorithms, so before I go to Nexel to reformat the date I'm wondering what other (possibly simpler) solutions people have found.

 

 

image

Answers

  • Helmut Heimann
    Helmut Heimann Employee, Community Captain
    50 Answers 500 Comments 250 Likes Fourth Anniversary

    Hi Brendan,

     

    did you try to format the date entity's block as "code"?

     

    HTH

    Helmut

  • Brendan Broughton
    Brendan Broughton Active Partner
    Third Anniversary 100 Comments 100 Up Votes 25 Likes

    Helmut Heimann, yes, it was already set to code, so I tried as Description with no luck. I THOUGHT I'd also tried text and numeric algorithms which didn't work....but I just tried those again it seems that sorting by NUMERIC algorithm equal to the Day entity gets the result I need.  Thanks for the prompt!

  • Hi Brendan Broughton,

     

    Can you try Taking that Date Block as entity in Layout > Then referring that Date Entity in a new algorithm Block as a (Number) in format and then using that same Block as Sort in Layout Option (Asc/Desc), and then Hiding it (if its not re-used frequently)

     

    i think that could help,

     

    Happy to help,

    Thanks and regards,

    Malav shelat

  • Brendan Broughton
    Brendan Broughton Active Partner
    Third Anniversary 100 Comments 100 Up Votes 25 Likes

    Hi Malav Shelat, yes that is what I did/mentioned in my reply above.  Thanks

  • Oh great, I missed that. Thanks Brendan Broughton