Search code examples
spotfire

Could not find function allprevious in Tibco Spotfire


Im trying to calculate the running sum for a line chart. The custom expression I'm using is

sum([cost]) OVER (AllPrevious([Axis.X]))

However, I get the error message: could not find function AllPrevious

However this error appears only if I pull the data via SQL/Jdbc. If the data origins from an excel sheet everything works fine.


Solution

  • The problem was that the query only works for in memory data. In-DB data requires the use of 'then', as row level data is not available.

    Hence the following statement needs to be used

    sum([cost]) then Sum([Value]) OVER (AllPrevious([Axis.X]))