Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

how to ignore filters in aggr set analysis

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!

3 Replies
PradeepK
Creator II
Creator II

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>

)

)

wanyunyang
Creator III
Creator III
Author

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

Ksrinivasan
Specialist
Specialist

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