Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

Help with set analysis

I got a Document with 2 tables (Inventory, and Retail)

The inventory table is related to Retail via a column called RetailKey

What i want to calculate is the original retail which is to get the first unit retail of each item and multiply it by sum of quantities

Actually the user has to select an up to date for quantities calculation and another retail date

my expression is as follows:

sum(aggr(FirstSortedValue({<H_BPDate={"<=$(vRetailDate)"}>}[Unit Retail], -H_BPDate)

*

sum(Total <RetailKey>{<[Transaction Date]={"<=$(vUpToDate)"}>}Quantity)

,RetailKey))

this expression is put in a pivot table with the following dimensions (Country, Business Unit, Season)

the results are correct but the performance is extremely slow

how can I enhance the above expression

Please advise

I can walk on water when it freezes
0 Replies