Search code examples
sumexpressioncategoriesspotfirequalifiers

How to sum data by in a category in Spotfire


What would the custom expression be to sum data by a category, for each site.

Using the data below, I would like to Sum[X] for only values with category blue, for each site

What I have so far is Sum([X]) OVER [Site] --> Where / how do I put in the category qualifier?

Example Data


Solution

  • what I found works best is: Sum(If([Category]="Blue",[X],0)) OVER ([Site])