Attachment Template Expression

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.

Kind Regards,
D

Solved Solved
0 2 454
1 ACCEPTED SOLUTION

Others are much better at expressions than I am. Hopefully, one of them will respond.

I am not sure why your expression begins with a Start expression. In a workflow template, you use a Start expression to format a set of rows. The value following Start should return the key values of the rows you want to format.

Have you tried simply placing your existing expression between << and >> in the workflow template?
We use the same expression system everywhere including workflow.

You may run into issues because the โ€œcurrentโ€ record in the workflow template may not be the same as in your app, but the expression syntax is the same.

View solution in original post

2 REPLIES 2

Others are much better at expressions than I am. Hopefully, one of them will respond.

I am not sure why your expression begins with a Start expression. In a workflow template, you use a Start expression to format a set of rows. The value following Start should return the key values of the rows you want to format.

Have you tried simply placing your existing expression between << and >> in the workflow template?
We use the same expression system everywhere including workflow.

You may run into issues because the โ€œcurrentโ€ record in the workflow template may not be the same as in your app, but the expression syntax is the same.

It works Phil. Wow I just want to say thank you so much, youโ€™ve really done a great thing for me Today. I didnโ€™t actually realize you could use formulas like this straight into attachment templates.

Top Labels in this Space