![]() |
#856 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
thank you for your help
I have the file name and asin. I have no clue how to do result. but i do have one other problem. The file names all have _ebok on the end. This will result in all of the compares resulting in no. Any idea for a work around? |
![]() |
![]() |
![]() |
#857 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
I have been fighting with this all afternoon. I figured out the file name issue but i cant make the custom column work.
Lookup Name: results Column Heading: Results Column Type: Column built from other columns Template: {results: strcmp(#asin, #file, yes, no, na)} But it doesn't work. What am I doing wrong? Please help |
![]() |
![]() |
Advert | |
|
![]() |
#858 | |
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
|
Quote:
Code:
{#asin:strcmp(#file, yes, no, na)} |
|
![]() |
![]() |
![]() |
#859 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
Thank you for your help. The equation works but isn't returning accurate results. Even though the asin and file name match its returning na NA should only come up if one or both fields are empty.
I've attached snapshots Im not sure why this is so difficult |
![]() |
![]() |
![]() |
#860 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,990
Karma: 30277294
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
![]() |
![]() |
Advert | |
|
![]() |
#861 | |
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
|
Quote:
Code:
program: strcmp(raw_field('#asin'), raw_field('#file'), 'yes', 'no', 'na'); |
|
![]() |
![]() |
![]() |
#862 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
BetterRed I was still getting na even though they matched
davidfor I tried your suggestion: template: {#asin:strcmp(raw_field('#asin'), raw_field('#file'), 'yes', 'no', 'na')} error: TEMPLATE ERROR: incorrect number of arguments for strcmp |
![]() |
![]() |
![]() |
#863 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You didn't actually try what he suggested. Try the 2 lines of code *exactly* as he wrote it, including the word "program". Note that there are not any curly braces in his suggestion.
|
![]() |
![]() |
![]() |
#864 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
i didn't know I could put the word program in there. OK done. Now it is returning NO even though they match. Is it possible that this is because I am using the GetFileName plugin to get the file name and extract the extension? So that even though I cant see the file extension in the File column, the system still does?
|
![]() |
![]() |
![]() |
#865 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#866 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
ok so it is working. What i am looking for is:
return "yes" if #asin = #file return "no" if #asin ≠ #file return "na" if #asin or #file is empty |
![]() |
![]() |
![]() |
#867 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: asin = raw_field('#enum2'); file = raw_field('#enum2'); first_non_empty ( strcmp(file, 'None', '', 'na', ''), strcmp(asin, 'None', '', 'na', ''), strcmp(file, asin, 'no', 'yes', 'no') ) |
|
![]() |
![]() |
![]() |
#868 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
Chaley I copied and pasted that directly into the template field for the results column and everything came back NA
|
![]() |
![]() |
![]() |
#869 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#870 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2015
Device: iPad mini with kindle app
|
IT WORKS!!!! Thank you everyone for your help.
|
![]() |
![]() |
![]() |
Tags |
custom column, tag, tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Should composite columns appear in Grouped Searches? | ownedbycats | Library Management | 3 | 02-13-2021 03:43 PM |
Having problems with composite columns and save/send templates | Trel | Calibre | 4 | 09-26-2016 03:21 PM |
Tooltips for narrow columns | theducks | Library Management | 7 | 03-16-2015 10:58 PM |
Techniques to use plugboards, custom columns and templates | kovidgoyal | Library Management | 0 | 01-26-2011 04:21 PM |