Comments on: generatedata API http://www.benjaminkeen.com/generatedata-api/ Web Developer Mon, 25 Apr 2016 14:10:41 +0000 hourly 1 By: ben.keen http://www.benjaminkeen.com/generatedata-api/comment-page-1/#comment-64191 Thu, 29 Jan 2015 17:33:39 +0000 http://www.benjaminkeen.com/?p=1974#comment-64191 Heya.

1. You can reference any other row by its number, so {$ROW5} will give you the value generated by the fifth row. So if {$ROW5} was a salary (number only) you could generate a commission by creating a Composite row with this in this options: {$ROW/5}

But please note: it’s really basic. If there was formatting on the salary value and it wasn’t a strict number, it may not work.

2. I’m afraid Composite only gets access to the *value* generated, not any additional metadata. Good idea, though! Create a feature request on github – that should be doable.

- Ben

]]>
By: dataman http://www.benjaminkeen.com/generatedata-api/comment-page-1/#comment-64189 Thu, 29 Jan 2015 17:07:19 +0000 http://www.benjaminkeen.com/?p=1974#comment-64189 Thanks Ben.

1)
Is there a reason why, we are not able to reference the current row.
I want a value in a column to be computed based on value of other column.
Example : Salary and commission. I need commission to be 20% of salary.

2) How do you reference a column in a composite field. You mention $ROW1, for a specific column do I use $ROW1.columnname ?

Thanks for any inputs.

]]>
By: ben.keen http://www.benjaminkeen.com/generatedata-api/comment-page-1/#comment-64055 Wed, 28 Jan 2015 03:52:05 +0000 http://www.benjaminkeen.com/?p=1974#comment-64055 There should be, yes – but it’ll sure be fussy. The content you enter can be Smarty content (PHP template language) and it’ll be evaluated and output. It’s good for simple things like {$ROW1+$ROW2} (check the help doc to make sure the syntax is right) but not so great for something like what you need. You’d need to convert the dates according to their output format, do a comparison and compute the mid-date. Not simple, but probably doable. I’d suggest reading up on Smarty: http://www.smarty.net/

Good luck!

- Ben

]]>
By: dataman http://www.benjaminkeen.com/generatedata-api/comment-page-1/#comment-64043 Wed, 28 Jan 2015 00:40:48 +0000 http://www.benjaminkeen.com/?p=1974#comment-64043 Hi,

Wondering if there is a way to do date arithmetic in the composite field.

Would like to create a date value that is between two other column values.

Thanks…

]]>