Skip to main content
Solved

Filter non-dimension columns

  • June 6, 2022
  • 3 replies
  • 161 views

Forum|alt.badge.img+7

How can I filter ‘Amount’ column, which is a number formatted column, so that it takes only negative numbers?

GL.Amount[by sum:GL.Month,GL.Account, GL.'Department Pigment'][Filter : Account.'Account Code'="11010"]

In the above formula, I am summing up transaction amounts from “GL” Transaction List  by Month, Account, and Department (which are all dimensions). However, I also want Pigment to take only negative amounts. I tried to paste [GL.Amount < 0] within the filter, but it keeps telling me that the system cannot do that, as GL.Amount is not a dimension but number.

Best answer by francois

Nathan is right, once you’ve done the BY, the result is no longer structured by the GL transaction. You’ll have to do the FILTER before, as such:

GL.Amount[FILTER: GL.Amount > 0][by sum:GL.Month,GL.Account, GL.'Department Pigment'][Filter : Account.'Account Code'="11010"]

3 replies

Nathan
Employee
Forum|alt.badge.img+12
  • Employee
  • June 7, 2022

Hi Dastan,

 

When you do [by:] you effectively remove the source dimension (GL) by aggregating, that means you cannot [Filter] on it anymore.

 

Try doing the Filter before the BY, in its own [ ] and you'll see that it works.


francois
Employee
Forum|alt.badge.img+13
  • Employee
  • Answer
  • June 7, 2022

Nathan is right, once you’ve done the BY, the result is no longer structured by the GL transaction. You’ll have to do the FILTER before, as such:

GL.Amount[FILTER: GL.Amount > 0][by sum:GL.Month,GL.Account, GL.'Department Pigment'][Filter : Account.'Account Code'="11010"]


Forum|alt.badge.img+7
  • Author
  • Master Author
  • June 7, 2022

Thank you both! It worked, and will be very helpful in other modelings.