Sorting on numeric values done as text instead of numeric


Hi,

 

I didn't find any topics on this, which surprised me as I can't imagine that I am the only person here with this issue.

I have a listview with in it a column with numeric data. I want to sort this data on this column, where I would find an order of 1,2,3,...9, 10, 11 a logic one. But the result of the List view sort is an order of 1,10, 11, 2,3,4,...

 

Does anyone know how to fix this?

 

 


14401i21AF6E01B0F11AC7.jpg


5 replies

Hello MdenHeijer,

 

I think your list is in order already. However, the IDs are not consistent hence it goes 1,2,3 and then starts all over again to 100, 101, 102, 4, 5 etc. Perhaps you have to have a look at your smartobject settings and perhaps share it with us. Is there a specific reason you want your ID to be text rather than number? Currently what does your smartonject look like? Does it have an autonumber "ID" apart from the  "id report question"?  

 

Either way, there is an ability to sort the list based on the column of your choice.

Step 1

Edit your list view and CLICK on "Rules" as depicted on the image. EDIT the "When the view execute initialize" rule.


 

 

 

 

 

 

 

 

 

Other options:

 https://help.k2.com/onlinehelp/k2five/userguide/5.0/default.htm#Create/Views/ListViewSettings.htm%3FTocPath%3DCreate%7CSmartForms%7CViews%7CList%2520Views%7C_____1

 

I hope this helps. If you find this post helpful in any way please could you mark it as such by "Mark As Solution" or "kudo" as it will be helpful to other members of the community who may encounter similar issues.

 

Thank you,

Katleho

Good day  @MdenHeijer;

 

Please check out with this formal documentation as it's explained better here regarding filtering and sorting (https://help.k2.com/onlinehelp/k2five/userguide/5.0/default.htm#Create/Views/ListViewSettings.htm)

 

Should you find the above information useful kindly mark such as "Accepted Solution, Kudo".

 

Regards;

Widson.

Userlevel 2

Hello  @MdenHeijer,

 

There is a fix for sorting a formatted column in a list view. I am not 100% sure if it fixes all issues with sortings but let's try it out.

 

If you are on K2 Five 5.1, apply FixPack 28: https://portal.k2.com/products/k2five5-1fix-pack28

& if you are on K2 Five 5.2, appy FixPack 3 : https://portal.k2.com/products/k2five5-2fix-pack3

 

Should you find the above information useful kindly mark as "Accepted Solution and/or Kudo", as this will assist other community members looking for related information.

 

Regards,
Beswick

 

[K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member]

 

Badge +10

I'm also having some weird behavior on a 'CreateDateTime' column where it's not sorting after I place a sort DESC on the List load.  Out of about 15 Loads of the view based on different filtered scenarios it's only working 2 times.  

The sort is defaulting in how I would like it too, however if the user clicks on the column header it does not sort.  The arrow moves like it is going to sort but it doesn't.

Using the same view, just different load methods & filters.  

Images Below -
Filter Setting / Sort Setting - 1 -  THIS WORKS
Filter Setting / Sort Setting - 1 -  THIS DOES NOT WORK

Any suggestions?

From what I know, my K2 Admin has uploaded the fix pack designated for 5.2 fix.






I've had a support call with the K2 support desk. They concluded the issue must be in our custom broker. My backend system is a SQL database, so I work around this by letting SQL sort the data through a stored procedure instead of letting K2 sort the data. I hope you find a similar workaround.

Reply