Table Listing Order - How do you order blank items last?

More
8 years 3 months ago #63771 by rhoeflich
I have a database of items . One of the fields is a Rating and the table listing is set to order on that Rating Field.
How do I sort it so those that have no rating (the field is empty) to display below those that have a rating (the field has content).

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

More
8 years 3 months ago #63778 by micker
you can use custom ordering => choose rating field and sorting type by number for exemple

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
8 years 2 months ago #63800 by rhoeflich
I have it on custom sort by Rating (by the way Rating is a custom field I created.)

The ratings are on a numerical scale of 1-20. I have it sort by ascending order so a Rating of 1 which is the highest rating is at the top, but instead all of the items with no rating or blank rating show first.
Is there a way to make the top rated appear first but the blank ones at the bottom?

or should I just make the non rated people a higher number than 20??

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

More
8 years 2 months ago #63806 by micker
number is 0-XXX always
nothing is 0 did you try second ordering ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
8 years 2 months ago - 8 years 2 months ago #63818 by ggppdk
Hello

no-values are saved for all built-in fields by not addin a DB row (aka value is NULL)
so unless you have code a new FLEXIcontent field TYPE, and you have made something different in "onBeforeSaveField"

using (with a performance impact ...):
ORDER BY ISNULL(value) ASC, value ASC

instead of:
ORDER BY value ASC

will work ... will add it


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 8 years 2 months ago by ggppdk.

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

More
8 years 2 months ago #63819 by ggppdk
Hello

i checked and placing NULLs last is already implemented

- what type of field type are ordering ? e.g. is it a "text" (text, number, etc) field
- what is the ordering configuration ?
- are you ordering in category view or in universal content module , both ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.476 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline