Products | Versions |
---|---|
Spotfire Analyst | All Versions |
When working with in-database data tables, the only functions allowed in custom expressions in calculated columns and in visualizations are those functions available on the external data source. This means Spotfire specific functions like the OVER functions are not available. It may not be obvious how to use the OVER function to create cumulative aggregations like the following cumulative sum on the y-axis of a visualization:
Sum([myDataColumn]) OVER AllPrevious([Axis.X])
If the same expression is used in a visualization based on an in-database data source, then you may see the following error in the visualization: "Could not find function 'AllPrevious'" (or other function name like 'Previous', "Next", etc). With the THEN keyword, it is possible to perform these cumulative aggregations.
Sum([Sales Total]) THEN Sum([Value]) OVER (AllPrevious([Axis.X]))
Count([Record No]) THEN Sum([Value]) OVER (AllPrevious([Axis.X]))
<Month([Date])>
Doc: Working With In-Database Data