|  07-03-2019, 12:00 AM | #1 | 
| Evangelist            Posts: 435 Karma: 572984 Join Date: Jan 2010 Location: Long Island Device: Kobo Libra 2, Kindle 4, Nook Gl4, Nook STR, REB 1100, Ebookwise 1500, | 
				
				Need help with composite column
			 
			
			I currently have two columns built from other columns called Collection1 and Collection2. I use them to create collections on my Kindle but I frequently end up with a lot of duplication. Collection1 is built from my custom columns #unread and #readinglist. Together these form the list of what I want to read next in various genres. Collection2 is built from the custom columns #fave, #fandom, and #fandom2. These are favorite stories that I want on my kindle because I'm likely to read them again. #fandom and #fandom2 will always have data in them. #unread, #readinglist, and #fave do not always have data in them. And therein seems to be the issue. What I want is a collection column where if {#unread:||.}{#readinglist} has data it populates the column (ie N.Read Next Gen), if those two columns are blank then it fills in {#fave:||.}{#fandom}.{#fandom2} (ie F.Fandom.Sub-Fandom) I tried using the first_non_empty({#unread:||.}{#readinglist},{#fave :||.}{#fandom}.{#fandom2}) but that resulted in the column reading: first_non_empty(N.Read Next Gen,Fandom.Sub-Fandom) or first_non_empty(,F.Fandom.Sub-Fandom2) I tried putting program: in front of it but that just returned a Template Error. I also tried putting If and then OR but got the same result as first_non_empty. I'm not particularly good and programming so I'm not sure what other functions I should try or if I'm just messing up the syntax. Any help would be greatly appreciated. Thanks. | 
|   |   | 
|  07-03-2019, 07:20 AM | #2 | 
| 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 think the following will work: Code: program:
first_non_empty(template("[[#unread:||.]][[#readinglist:]]"),template("[[#fave:||.]][[#fandom]].[[#fandom2]]")) | 
|   |   | 
| Advert | |
|  | 
|  07-03-2019, 11:42 AM | #3 | 
| Evangelist            Posts: 435 Karma: 572984 Join Date: Jan 2010 Location: Long Island Device: Kobo Libra 2, Kindle 4, Nook Gl4, Nook STR, REB 1100, Ebookwise 1500, |     It worked perfectly. Thank you so much for your help. | 
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Composite column template question | Anna_R | Library Management | 4 | 06-03-2015 03:59 AM | 
| Composite Column | BetterRed | Calibre | 12 | 09-01-2013 04:58 AM | 
| Set value of another column from composite? | dirgeon | Library Management | 1 | 02-03-2013 11:40 AM | 
| Composite column or not ? | Bertrand | Library Management | 3 | 08-24-2011 01:27 AM | 
| Custom Composite Column | silentguy | Calibre | 4 | 11-24-2010 10:28 AM |