View Single Post
Old 03-24-2016, 09:35 PM   #11
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
Hic, I know nothing about codes.
The best I could do to this is:
Code:
program:
val = field('#pages');
first_non_empty(
	cmp(val, 6, 'very short (~90)', '', ''),
	cmp(val, 11, 'short (91-200)', '', ''),
	cmp(val, 16, 'medium (201-450)', '', ''),
	cmp(val, 21, 'large (451-1000)', '', ''),
	'very large (1001~)');
I don't understand the figures right after val.

In my case, #pages include number of pages.

I created a new custom column based on other column and pasted the code to the box underneath that. (I think I did it wrong).

Please correct me.

Edit: Forget it, I figured it out. . Done.
It became like this
Code:
program:
val = field('#pages');
first_non_empty(
	cmp(val, 90, 'Rất ngắn (~ 89)', '', ''),
	cmp(val, 250, 'Ngắn (90-249)', '', ''),
	cmp(val, 550, 'Vừa (250-549)', '', ''),
	cmp(val, 1200, 'Dài (550-1199)', '', ''),
	'Rất dài (1200 ~)');

Last edited by nqk; 03-25-2016 at 06:25 AM.
nqk is offline   Reply With Quote