| 
			
			 | 
		#1 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 7 
				Karma: 10 
				Join Date: Mar 2012 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
			
			 
				
				"New" sort in text column
			 
			
			
			Hi. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	In my Calibre library I stored Star Wars eBooks and I have problem. I have column "Timeline" where I set data like: 
 I need sort it first for text (BBY before ABY) and after sort the numbers like: 
 But I don't have any idea how I can do this. If I use text type for this colum it give me: 
 Someone can help me, please?  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			1) Sorting is left to right  (known as an Alpha Sort) 
		
	
		
		
		
		
		
		
		
		
		
		
		
			2) Leading Zeros are needed on numbers so that all digits have the same amount of characters. Keeping that in mind The letters need to be first if they are more important to the sort (rule 1) to keep the secondary info in order you need to use rule 2 Except you can use an additional space instead because the digits are NOT at the beginning of the string (note that spaces are very hard to see when editing, making the ugly leading zero a better choice) EDIT I just noticed you want ABY after BBY   that is a reverse sort in the middle of a string.The only way I see, is 2 columns: Year, Era Sort by Year to set the number bias, the sort by Era (descending) Last edited by theducks; 03-11-2012 at 11:49 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 7 
				Karma: 10 
				Join Date: Mar 2012 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			It's doesn't work. My 2 times: 
		
	
		
		
		
		
		
		
		
		
		
		
	
	36453 BBY 5000 BBY and when I change it to 036453 BBY 005000 BBY it's give me 005000 BBY 036453 BBY  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			That was Sort Ascending (the first time click) 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Click the column head again OR Right click the column heading and select Sort on: Descending  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 7 
				Karma: 10 
				Join Date: Mar 2012 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Thanks, it's work! 
		
	
		
		
		
		
		
		
		
		
		
		
	
	It is possible to hide this column but sort by it?  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#6 | |
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Set your Startup sort(s)(direction) order in the Preferences: Tweaks Note this sorting only lasts until you sort on a different column (the tweak stays) Then you will need to restart or un-hide and then sort again. The column position can be placed anywhere  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 7 
				Karma: 10 
				Join Date: Mar 2012 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Thank You very much. It's work perfect!
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905 
				Karma: 47303824 
				Join Date: Jul 2011 
				Location: Sydney, Australia 
				
				
				Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Having read this, and after checking what "BBY" and "ABY" meant, I would be tempted to store the years as a number. Then use a negative number for BBY and a positive for ABY. I would probably leave it at that, but I think you could create a column that displays this as a positive number with the suffix. But, I'm not sure if you could get this column to sort using the original. Unfortunately, I don't have my laptop and Calibre with me today to experiment.  Though it is fortunate for my work productivity  
		
	
		
		
		
		
		
		
		
		
		
		
	
	 
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#9 | 
| 
			
			
			
			 Zealot 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 110 
				Karma: 194274 
				Join Date: Jun 2011 
				Location: Montreal 
				
				
				Device: Kobo, Calibre 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			If I had more Star Wars Book I'd do this. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Also take a look at View Manager plugin to save multi column sorts. Call it Star Wars and it sort by Timeline, Series, Author.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#10 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905 
				Karma: 47303824 
				Join Date: Jul 2011 
				Location: Sydney, Australia 
				
				
				Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I had a play with the suggestion I made.  Unfortunately, it didn't work. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	I added two columns: - #year - Integer - #yearepoch - a column based on another. For the #yearepoch, I used the template: {#year:'cmp($, 0, multiply($, -1), $, $)'} {#year:'cmp($, 0, 'BBY', 'ABY', 'ABY')'} This gives a display like what was asked for. Unfortunately, the sorting is based on the displayed data, not the value of #year.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#11 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 7 
				Karma: 10 
				Join Date: Mar 2012 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I do this with column with positive and negative years (BBY is - and ABY is +) and it's work greate. Finally I can change age representation for pos/neg char.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Custom column: "Updated date", when adding new "versions" of the same file? | enriquep | Library Management | 16 | 11-03-2011 11:46 AM | 
| Opus "Search in text" feature | Heavymachinegun | Bookeen | 8 | 10-22-2009 11:52 AM | 
| Question - Does iLiab have the "search" & "annotation, highlighting" features? | HiSoC8Y | iRex | 5 | 07-01-2009 05:37 PM |