Hey guys, I hope you are having a wonderful day / night. Unfortunately I’ve been having some trouble on an expression in my Attachment Template. I know this formula works inside of a virtual column, but when trying to use it in the attachment template I’ve ran into some trouble.
It’s a Select expression, and in the Virtual Column it looks like so…
SUM(SELECT(s0[KG],AND([_THISROW].[Paper Type]=[Paper Type],[Category] = “RECEIVE”))) - SUM(SELECT(s0[KG],AND([_THISROW].[Paper Type]=[Paper Type],[Category] = “SEND”)))`
Basically, it’s a product stock control formula that totals the received for a given paper product, and minuses it from the sent to give a ‘current stock’ value inside of a virtual column to give a numerical value (in Kilograms).
Now this is the difficult part… when trying to create the same result in an attachment template I’m running into issues. I’ve tried different variations of ‘filter’ and ‘select’, and while I have experience in listing items on an attachment template, I don’t know how to work in a Filter AND SUM option concurrently to aggregate the data in these rows like I did in the original formula listed above.
Here’s the formula I tried:
<<Start:SUM(FILTER(“s0”, [Category] = RECEIVE))>> <<KG>> <<End>>
No luck though, as this is the error I get. I have little experience in using REF columns so I can’t really figure out where I’m going wrong and what I need to change.
I’d really appreciate the help guys, as I know this will be a very useful thing to know going forward when it comes to making reports inside of attachment templates.