Search code examples
spotfire

SpotFire - Sum up values over multiple Columns


I need to sum the Net_Amount column in my table over 3 different columns those columns being:

  • UWI

  • Year

  • Month

How do I go about doing this? Please note I would like to do this through the data canvas

enter image description here

I tried doing Sum___ Over Data transformation but I cannot seem to make it work for multiple columns.


Solution

  • Do you mean you need to sum [Net_Amount] for every distinct combination of UWI, Year and Month? In that case you would define the new sum column with this expression:

    sum([Net_Amount]) over intersect([UWI],[Year],[Month])
    

    You can add a calculated column via the data canvas as well as outside of it.