Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am writing this expression
if (Product.Amount > 0 and aggr(count(distinct Product.SalesDates),Product) > 0, Product.Name)
then it works
but when i do
if (Product.Amount > 0 and aggr(count(distinct Product.SalesDates),Product) = 0, Product.Name)
then it does not work.
The data is available for the second expression also.
why?
try below
aggr((count(distinct Product.SalesDates) = 0),if (Product.Amount > 0),Product.Name)
Can you describe the context of this expression? If it's used in a straight table, please specify which dimensions are used.
It has the same problem,
It works when i use >0 and does not work when i use =0
It is in a pivot table.
The dimension used is Product.Name.
Why do you use aggr() when a Product selection is being made by the dimension anyway?
If PRoduct.Amount is connected to Product.Name is connected to Product in a 1:1 fashion, and each Product may have zero or more SalesDates, then what about this expression:
IF ((Product.Amount > 0) and (Count(DISTINCT Product.SalesDates) = 0), ...)
I think count needs aggr() else it shows "error in the calculated dimension"
So you are actually using this expression in a Dimension? Not just the Product.Name as a dimension?
Please describe what it should produce as dimension values. Thanks.
you are right.
this is dimension. the dimension value should be the product name which does not have any sales date associated with it.
And what is the actual expression? You're sure you can't reduce the set of available Product.Names to those without sales by using set analysis in your expression?