Template Report [Solved]

I have a template report which outputs the data to a table. However the cost fields are calculated fields & even if there is a zero value, a 0 is both sent to the Google sheet & to the template. The expression to calculate the cost field is: (ANY(SELECT(BevDB[CostPerUoM],[Ingredient]=[_THISROW].[Ingredient1])))*[Qty1]
I have tried the following IF statement to have the output blank, BUT it still outputs a 0 & not a blank cell. Any help is appreciated. Cheers

SOLVED with this formula thanks to @Steve & @1minManager for helping me out.
ANY(LIST(ANY(SELECT(BevDB[CostPerUoM], ([Ingredient] = [_THISROW].[Ingredient1]))) * [Qty1]) - LIST(0.0))

Solved Solved
1 8 238
1 ACCEPTED SOLUTION

Try:

ANY(LIST(ANY(SELECT(BevDB[CostPerUoM], ([Ingredient] = [_THISROW].[Ingredient1]))) * [Qty1]) - LIST(0.0))

Assuming the result is Price or Decimal.

View solution in original post

8 REPLIES 8

Try this expansion on your equation to make it show nothing in the tempate:

<<IF
ISBLANK((ANY(SELECT(BevDB[CostPerUoM],[Ingredient]=[_THISROW].[Ingredient1])))[Qty1]),
โ€œโ€,
(ANY(SELECT(BevDB[CostPerUoM],[Ingredient]=[_THISROW].[Ingredient1])))
[Qty1]
)>>

Simon@1minManager.com

Thanks @1minManager, I gave it a try but still have zeros in the sheet & report. Cheers

Try:

ANY(LIST(ANY(SELECT(BevDB[CostPerUoM], ([Ingredient] = [_THISROW].[Ingredient1]))) * [Qty1]) - LIST(0.0))

Assuming the result is Price or Decimal.

@Steve thx mate, the result is Price. Iโ€™ll give it a go now. Cheers

Hi @Steve I tried but got this error when saving the expression::
The expression is valid but its result type โ€˜Listโ€™ is not one of the expected types: Price

Yep. I noticed after your reply I forgot ANY(). I revised the expression above.

@Steve 100% mate that works! Did you just deduct the value 0.0 from the result? Thx mate appreciate it!

We calculate the amount using your original expression, put the result into a (one-item) list, then use list subtraction to remove any items in that (one-item) list that have a 0.0 value. If the result was 0.0, itโ€™s removed; if it wasnโ€™t 0.0, it remains.

See also:

Top Labels in this Space