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: 
McDanny
Contributor
Contributor

Joining 2 tables on specific date condition

In Qlik Sense I have these tables:
Costing:
Load
OBJNR,
Order,
OrderType,
MaterialGroup,
Material,
Description,
PostingDate,
Quantity,
UnitOfMeasure,
B_MAT_ORD,
B_TIM_ORD,
B_TOT_ORD,
B_MAT_COS,
B_TIM_COS,
B_TOT_COS,
A_MAT_ORD,
A_TIM_ORD,
A_TOT_ORD,
DIFF_MAT_ORD,
DIFF_TIM_ORD,
DIFF_TOT_ORD
From $(vPadQVD)MTO_Costing.qvd(qvd);

and

SalesBudget:
Load
sales_price_valid_from,
Material,
B_TIM_H_PROD_SAL,
B_TIME_H_ENG_SAL,
B_SMALL_PART_SAL,
B_UL_PLATE_SAL,
B_MAT_SAL,
B_MAT_TOT_SAL,
B_TIM_PROD_SAL,
B_TIM_ENG_SAL,
B_TIM_TOT_SAL,
B_TOT_SAL,
B_MARG_PERC_SAL,
B_MARG_SAL,
B_PRICE_SAL
From $(vPadQVD)MTO_Sales_Budget.qvd(qvd);

The key is field Material.
Table SalesBudget can have multiple rows with the same value for Material, with each a different date value in sales_price_valid_from.
I want to add the fields of table SalesBudget to table Costing,
where the date in sales_price_valid_from of table SalesBudget is the MOST RECENT AND BEFORE the date PostingDate of table Costing.
How do I do that?

 

Thanks,

McDanny

Labels (1)
0 Replies