Jump to content
wattmhite

sort by current year vs all others

Recommended Posts

I have a date field and I'm currently sorting all of my records by year is 2016 then 2015 then 2014 then etc etc.

I would like to sort this by current year i.e. 2016) then all other records 2015, 2014, 2013 together.

What is the best way to accomplish this?

 

Thanks

 

Share this post


Link to post
Share on other sites

Your question is not clear. What exactly does "together" mean in the context of sorting? Why would sorting by date, descending, not accomplish the task?

Share this post


Link to post
Share on other sites

my table is currently sorted with: year (get(currentdate)) so every section breaks down my accounts by year (2016, then 2015 then 2014) So I'm trying to have 2 sections in my table, the top section is all current year accounts, the next section is all other accounts 2015-2000 all lumped together (not in sections)

Share this post


Link to post
Share on other sites
15 minutes ago, wattmhite said:

I'm trying to have 2 sections in my table, the top section is all current year accounts, the next section is all other accounts

If you're talking about sections, then you're talking about more than just sorting. To enable such grouping, define an unstored calculation field (result is Number) =

Year ( YourDateField ) = Year ( Get ( CurrentDate ) ) 

then sort and group by this field.

 

14 minutes ago, wattmhite said:

my table is currently sorted with: year (get(currentdate)) so every section breaks down my accounts by year (2016, then 2015 then 2014)

No, that's not possible: Year ( Get ( CurrentDate ) ) returns the same value for every record, so sorting by it is meaningless.

 

 

Share this post


Link to post
Share on other sites

You could view your records through a portal that you filter.

You could have a popup menu (chooser) that you set for current year/all previous years. Then on the portal you can filter based on your choice, and show either where:

Year ( YourDateField ) = Year ( Get ( CurrentDate ) ) 

or

Year ( YourDateField ) > Year ( Get ( CurrentDate ) ) 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.