Discussion board where members can get started with Qlik Sense.
I have a Table 1 with price list changes for a commodity:
(for about 1000 commodities and several years)
And I have a Table 2 with orders (but w/o prices), and I need to get correct price from Table 1 on the basis of order date so it should look like (marked red):
Order date should be compared to price change dates, and the closest from the past should be taken (or the same date if order date equals date of change).
How it can be done using Qlik?
LET vCurrentDate = Today();
"Date of change",
FROM [lib://path_DB (rbcgrp_ostapchuk)/test\price_order.xlsx]
(ooxml, embedded labels, table is [Table 1]);
(ooxml, embedded labels, table is [Table 2]);
"Date of change" as DateStart,
date(if(Previous("Commodity ID")="Commodity ID",peek('DateStart')-1,'$(vCurrentDate)')) as DateEnd,
"Date of change" desc;
Drop Tables price;
Inner Join IntervalMatch("Order Date","Commodity ID")