Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I Have a Table having M.Date,Matnr,Location ,Qty which is a Transactional Data . If any manfurating Data is missing for that particular MATNR and Location new row should be created in Data stating 'Not Produced', .
Below is the data for Reference:
Input Data:
Output Data:
@QVUser1 may be this
Data:
LOAD * Inline [
Manufacturing Date,MATNR, LOCATION,QTY
05/01/2021,1234,ABC,50
06/01/2021,1234,ABC,60
08/01/2021,1234,ABC,70
09/01/2021,2345,BSD,59
11/01/2021,2345,BSD, 69];
Join(Data)
LOAD MATNR,
LOCATION,
date(min_date +IterNo()-1) as [Manufacturing Date]
while min_date +IterNo()-1 <= max_date;
LOAD MATNR,
LOCATION,
min([Manufacturing Date]) as min_date,
max([Manufacturing Date]) as max_date
Resident Data
Group by MATNR,
LOCATION;
Final:
NoConcatenate
LOAD [Manufacturing Date],
MATNR,
LOCATION,
if(len(trim(QTY))=0,'Not Produced',QTY) as QTY
Resident Data;
DROP Table Data;
You may need to use Peek function along with order by statement if you have more columns in your table to get the previous value if current values is NULL. See the attached document for the same
Thanks For the Above Reply .
But I See Some Data is Duplicating and Creating' -' value in the data.
I am Calling the key from link table where the data is duplicating and creating this null value