Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
I have a table
T1:
DATE,
PART,
NAME,
DEPARTMENT
VALUE
I for some part, name and department date field is null.
I want to add dates in this field. For example
DATE PART NAME DEPARTMENT VALUE
30.6.2018 306 A 312 0
NULL 306 A 312 0
I want make
DATE PART NAME DEPARTMENT VALUE
30.6.2018 306 A 312 0
1.7.2018 306 A 312 0
2.7.2018 306 A 312 0
3.7.2018 306 A 312 0
4.7.2018 306 A 312 0
Last row is for last date (today())
Thanksss
Jasmina
Hi,
If you just want to populate data from your date to today, this script will do the job :
// Replace T1 with your source file
T1:
LOAD *,
Date(Date#(DATE,'DD.M.YYYY'),'DD.M.YYYY') as Date_ID
;
load * inline [
DATE,PART,NAME,DEPARTMENT,VALUE
30.6.2018,306,A,312,0
];
NoConcatenate
FINAL:
LOAD Date_ID+iterno()-1 as Date_ID,
PART,
NAME,
DEPARTMENT,
VALUE
resident T1
while Date_ID+iterno()-1<=today();
Drop table T1;
Have a look at this blog post: How to populate a sparsely populated field
Hi,
If you just want to populate data from your date to today, this script will do the job :
// Replace T1 with your source file
T1:
LOAD *,
Date(Date#(DATE,'DD.M.YYYY'),'DD.M.YYYY') as Date_ID
;
load * inline [
DATE,PART,NAME,DEPARTMENT,VALUE
30.6.2018,306,A,312,0
];
NoConcatenate
FINAL:
LOAD Date_ID+iterno()-1 as Date_ID,
PART,
NAME,
DEPARTMENT,
VALUE
resident T1
while Date_ID+iterno()-1<=today();
Drop table T1;
Thank you all, I think I made it...