Jump to content
  • 0

Column Sorting Challenge


HeyItsDoug

Question

So I have a basic 3 field table with one of the fields being Day of Week.   The Day of Week field is a static populated drop down with "Sunday, Monday, Tuesday".... etc,    My users can create multiple entries within this table using the same Day of Week.   I'm trying to figure out how I can forcibly sort the Day Of Week column to always display the Days of Week in sequence; Sunday, Monday, Tuesday etc.  But I need each instance of the DOW, to be sequential.  Example being the following 5 rows...

Sunday     'tttt'

Monday    'xxxx;

Monday   'yyyy'

Tuesday   'uuuu'

Wednesday  'rrrr'

 

When my use enters a new row with DOW of Sunday,  I need that new row to be listed directly below the existing Sunday row and not alphabetized which would place it right before Tuesday.

Any ideas?  I hope this made sense.

Thanks

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello @HeyItsDoug,

To sort the field by the correct sequence of the day, I suggest that you have a calculated field in the form to convert the Day of the Week to an integer. 

CASE WHEN [@field:DOW] = 'Sunday' Then 1
WHEN [@field:DOW] = 'Monday' Then 2
WHEN [@field:DOW] = 'Tuesday' Then 3
WHEN [@field:DOW] = 'Wednesday' Then 4
WHEN [@field:DOW] = 'Thursday' Then 5
WHEN [@field:DOW] = 'Friday' Then 6
WHEN [@field:DOW] = 'Saturday' Then 7 
END

image.png.239bf099b18153d6d65f822f6fcc181a.png

Then, hide this calculated using custom CSS. Insert Header/Footer and paste this code: You may refer to this forum post 

 

<style>
#target table:nth-of-type(1) td:nth-of-type(3)  {display: none;}
#target table:nth-of-type(1) th:nth-of-type(3)  {display: none;}
</style>

</header>
<div id="target">
<header>

Lastly, on the Results Page Options, sort the report by this Calculated field.

image.png.c0971f870ef37f9d23f443e947b77cdb.png

Hoping that this will be your expected result:

image.png.25c0f5f5e483cf2d2f323bc9c912bbdb.png

Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...