| 
			
			 | 
		#1 | 
| 
			
			
			
			 Custom User Title 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,359 
				Karma: 79528341 
				Join Date: Oct 2018 
				Location: Canada 
				
				
				Device: Kobo Libra H2O, formerly Aura HD 
				
				
				 | 
	
	
	
		
		
			
			 
			
			I've been reading over the template language page over and over but I'm not having much luck understanding what to do.  
		
	
		
		
		
		
		
		
		
		
		
		
	
	I have two columns, #read (yes/no) and #lastread (date). I was trying to make a composite #currentlyreading column that returns a yes/true result if #read:false and #lastread is set to anything. (I'd like to use it for sorting my currently-reading books to the top of the list in View Manager.) I was trying to use the check_yes_no and if not empty but all my results either got strings of code or template errors appearing in the composite column.  
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525 
				Karma: 8065948 
				Join Date: Jan 2010 
				Location: Notts, England 
				
				
				Device: Kobo Libra 2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Use the template 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Code: 
	program: 
	test(check_yes_no('#mybool', 0, 1, 0),  test(field('#mydate'), 'Yes', ''), '')
Note that this template returns "Yes" or empty. If you want "No" then change the empty strings ('') to 'No'. You can also distinguish between the Yes/No column set to False when there is no date by changing only the first ''. You might want to check the box "Show checkmarks" in the definition of your composite column.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Custom User Title 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,359 
				Karma: 79528341 
				Join Date: Oct 2018 
				Location: Canada 
				
				
				Device: Kobo Libra H2O, formerly Aura HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			It works! 
		
	
		
		
		
		
		
		
		
		
		
		
	
	I changed #read to 1, 1, 0 so that it also gets undefined states (I don't use the tristate y/n columns, so a non-set one displays as 'no') and it works well.  
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Need help with composite column | BookJunkieLI | Library Management | 2 | 07-03-2019 12:42 PM | 
| Composite Column | BetterRed | Calibre | 12 | 09-01-2013 05:58 AM | 
| Set value of another column from composite? | dirgeon | Library Management | 1 | 02-03-2013 12:40 PM | 
| Composite column or not ? | Bertrand | Library Management | 3 | 08-24-2011 02:27 AM | 
| Custom Composite Column | silentguy | Calibre | 4 | 11-24-2010 11:28 AM |