Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I'm trying to write a function which doesn't change with SalesDate & StockDate filters. This is what I wrote:
sum(aggr({<SalesDate,StockDate,SalesDate={"<=$(=MAX(CompareDate))"}>}(Max(CompareDate)-SalesDate)*sum(Quantity),Customer, Item,SalesDate))
CompareDate is a date which doesn't link to any table.
The function doesn't work. Numbers still change with SalesDate & StockDate.
Any advice helps. Thank you in advance!
I do not see any ignore field condition in your set expression for SalesDate & StockDate.. Moreover you are explicitly setting them to <=MAX(date) i.e All possible values less than equals to max Cmpdate..
You can Ignore field selections by adding <fieldName> = .. in Set Expression.. Try below syntax :
Sum(
Aggr(
{ < StockDate,SalesDate = > }
<Function>
,<dim list>
)
)
Hi Pradeep,
Thank you for your reply.
I tried a simple one:
sum(aggr({<StockDate=,SalesDate=>}(Max(CompareDate)-SalesDate)*sum(Quantity),Customer,Item,SalesDate))
Numbers still change with SalesDate&StockDate filters
hoi,
try this only function.
wherever Sales date, Stock Date, you can replace with respectively,
Only(SalesDate)
Only(StockDate)
sum(aggr({<SalesDate,StockDate,SalesDate={"<=$(=MAX(CompareDate))"}>}(Max(CompareDate)-SalesDate)*sum(Quantity),Customer, Item,SalesDate))
Ksrinivasan