Skip to Content Skip to Menu

list order by country

10 years 8 months ago #242113 by thewebsurfer
list order by country was created by thewebsurfer
i set the user list order by country (ASC): in this way the users who havent set the country are on the top, there is a way to have this order (by country ASC) but those users at the end?
in other words: first of all the users who set the country

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #242129 by krileon
Replied by krileon on topic list order by country
The best approach is to probably filter out users that have no set a country so users with no country aren't displayed at all. I don't think you can double sort like the way you're wanting.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

10 years 8 months ago #242134 by thewebsurfer
Replied by thewebsurfer on topic list order by country

krileon wrote: The best approach is to probably filter out users that have no set a country so users with no country aren't displayed at all. I don't think you can double sort like the way you're wanting.


i don't want a double sort, i just want the users with no country at the bottom of the list instead of top

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #242136 by krileon
Replied by krileon on topic list order by country
You'll have to order as DESC instead of ASC so the blank values are placed last instead of first. That's just how SQL orders it.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

10 years 7 months ago #242137 by thewebsurfer
Replied by thewebsurfer on topic list order by country

krileon wrote: You'll have to order as DESC instead of ASC so the blank values are placed last instead of first. That's just how SQL orders it.


in this way i have Z-A order, i guess there is no easy way to do what i want..

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8281
  • Karma: 1443
10 years 7 months ago #242139 by krileon
Replied by krileon on topic list order by country

in this way i have Z-A order,

Correct, making the blank values last as SQL sees them before A or any other character.

i guess there is no easy way to do what i want..

Only way with Userlists is to filter out the empty values. Normally you'd just do a IF conditioned ORDER BY to have a custom order, but that'd be really slow as it can't be indexed.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum