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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
suvechha_b
Creator III
Creator III

Need Help

I want to fetch the product details which is having max(contract_start_date)

Please find the sample model attached

Result :

Mark in yellow

sample.PNG

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you want the max contract_start_date per product I'd create a flag field in the script:

JOIN (SupplierOrders)

LOAD product_key, max(contract_start_date) as contract_start_date, 1 as IsMaxContractStartDate

Resident SupplierOrders

Group By product_key;

You can then use that new field to select the records you need. Change your expressions to select them: sum({<IsMaxContractStartDate={1}>}[Order Qty])


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you want the max contract_start_date per product I'd create a flag field in the script:

JOIN (SupplierOrders)

LOAD product_key, max(contract_start_date) as contract_start_date, 1 as IsMaxContractStartDate

Resident SupplierOrders

Group By product_key;

You can then use that new field to select the records you need. Change your expressions to select them: sum({<IsMaxContractStartDate={1}>}[Order Qty])


talk is cheap, supply exceeds demand