Spotfire- calculated column with row ratios based on condition -


i’m having trouble understanding if spotfire allows conditional computations between arbitrary rows containing numerical data repeated on data groups. not find cue me onto right solution.

context (simplified): have data sensor reporting state of process , data grouped bursts/groups representing measurement taking several minutes each. within each burst sensor measuring signal , if predefined feature (signal shape) detected sensor outputs calculated value, v quantifying feature , reports runtime @ happened.

so in essence have 3 columns: burst number, set of rts within burst , values associated these rts. need add calculated column ratio of values rows rt equal specific number, let’s 1.89 , 2.76.

example of data table

the high level logic be:

if value exists @ 1.89 run time , value exists @ 2.76 run time compute ratio of these values. repeat every burst. understand can repeat computation on groups using on operator i’m struggling logic within each group... tips appreciated. many thanks!

the first thing need here apply order dataset. assume sample data complete , encompasses cases in real data, thus, create calculated column:

rowid() [rowid] 

once done, can create calculated column compute ratio on it's respective groups. note, b4 example incorrect compared other groups. is, have numerator , denominator reversed.

if(([rt]=1.89) or ([rt]=2.76),[value] / max([value]) on (intersect([burst],previous([rowid])))) 

breaking down...

  • if(([rt]=1.89) or ([rt]=2.76), limits rows rt = 1.89 or 2.76.
  • next comes evaluation if above condition true
  • [value] / max([value]) on (intersect([burst],previous([rowid])))) takes value row , divides max([value]) on grouping of [burst] , allprevious([rowid]). noted intersect() function. so, denominator previous value grouping. note max() simple aggregate used, should case since expecting single value. over() functions require , aggregate limit result set single row.

results

results


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -