I'm trying to figure out how I can calculate the time-weighted rate of change from a dataset with "t_stamp" and "value" columns with your toolkit expression functions, but i'm a bit lost with the starting at i=1 and ending at i(n-1) but still using i(n)
What a terrible example. That equation simplifies to (vn - v1) / (tn - t1). No need for the intermediate rows. (It does not yield 90, fwiw.)
The lag() function yields xr-1, with a null for the first row. Wrap lag() in a coalesce() to substitute in that first row. Or include an extra row as first, then cut it off with a where().
Tuck away what I show, though: if you replace the denominator with a time unit constant expressed in millis, the expression yields the integral of v dt in that timebase.
Expressions are pure java, except where a function author deliberately calls out to jython. In IA's stuff, only the runScript() expression hands off to jython.
In my toolkit, objectScript() is souped-up version of runScript(), and view() uses jython, too.
The reason users are advised to use expressions instead of scripts where possible is because the jython interpreter has significant overhead. And it is an interpreter, with all that implies.
deriving a single working tagpath from âfuzzy matchingâ on unordered/unspecified path parts passed in to a view. could be from flex repeater instance parameters, implicit rowData parameters, cell value parameter, etc. Each method has limitations and I donât want to hardcode fullpaths, but could end up with duplicates. I could just iterate over the duplicates, but thought might as well deduplicate them
speaking of - Iâm sure Iâve figured out why folder tag bindings return â2â, but canât remember at the moment.
for instance each highlight is the exact same embedded view, but
subview components are using full tag paths (results of system.tag.query from each rowâs hidden fullpath column
most table columns are using derived paths based on cell value, rowdata and column viewparams with an âaltPathsâ list of possible subpaths/tagnames
% Valid column is using a completely different path that canât be derived entirely from rowdata so using string replacement(indirection) on a âparameterizedâ âfull pathâ coming from the same column viewparams âaltPathsâ list
Yes, you can emulate set() with something like this:
forEach(
asMap( // Keys of a map are forced to be unique.
forEach( // Convert simple list to list of pairs where the 2nd value is a dummy
{path.to.list.of.strings},
it(),
""
)
),
it()[0] // Extract the unique keys back out of the map.
)
Just wanted to say that this module has once again saved me a bunch of work.
Needed to filter a dataset, because it couldn't be done in a Named Query, and I really didn't want to have to script the query, just be cause NamedQueries can not utilize a list to facilitate an IN clause.
where() to the rescue.
Sometimes, I wonder how much time I would waste without this module.