Download presentation
Presentation is loading. Please wait.
1
September 12-14, 2018 Raleigh, NC
2
Informer Scripting Andrew Morovati Chief Solutions Architect Entrinsik
3
Scripting in Informer Javascript: Calculated Columns Power Script
Saved Functions
4
Javascript Not Java Extremely lenient Widely used
Server and browser side
5
Web Resources https://www.w3schools.com/js/ - basic tutorial
- another tutorial, covers less detail and more concepts - online practice area
6
Javascript Types String Number Date boolean: Array falsy: Object {
name: ‘Andrew’, ‘Hello World’ age: 102, Number birthDate: new Date(‘1916’) 23 } Date boolean: new Date(‘ ’) true, false Array falsy: [2,3,4,0] false, 0, ‘’, “”, null, undefined, NaN Object
7
Embedded Helper Libraries
MomentJS - makes dates easier var momentDate = moment({date column}); Lodash (_) - lots of utilities var obj = _.assign({},’order.amount’,23.98);
8
Calculated Columns Defines a column in a dataset no return statement
no assignment
9
Power Script Flow Step Act on the row
May assign or reassign column values May store values in an accumulation area May delete a row from the data
10
Power Script Elements $record is the row
$record.firstName = ‘Greg’; $local is a place to store values $local.totalPrice += $record.price; $omit() removes the row if($record.amt > 0) { $omit(); }
11
Flush Flow Step Allow all rows to flow through the previous flow steps before proceeding. Then if you accumulated values in $local, you can use those for more columns. Processing intensive, so be careful.
12
Saved Functions Can do anything that power script can do
Simplifies scripts for less savvy designers Can be used to manipulate the entire row of data Can be tweaked at a later time if can be made more efficient. One saved function can return a whole library of utilities
13
Example - Student Transactional Data Analysis
14
QUESTIONS?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.