Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
d_koti24
Creator II
Creator II

Issue in Slowly Changed Field Split Date field into From and to Dates

HI all,

 

I need to split date field as two different fields(FromDate,ToDates).

please find the attached file for Example.

 

Thanks in Advance.

Koti.

 

 

1 Solution

Accepted Solutions
sunny_talwar

Try this

VACATION:
LOAD Code, 
     CodeID, 
     FieldDate, 
     Empname,
     Ceil(AutoNumber(RecNo(), Code&CodeID&Empname)/2) as TempField1,
     Mod(AutoNumber(RecNo(), Code&CodeID&Empname), 2) as TempField2
FROM [Temp.xlsx]
(ooxml, embedded labels, table is Sheet2);

FinalTable:
LOAD Code,
	 CodeID,
	 FieldDate as From,
	 Empname,
	 TempField1
Resident VACATION
Where TempField2 = 1;

Left Join (FinalTable)
LOAD Code,
	 CodeID,
	 FieldDate as To,
	 Empname,
	 TempField1
Resident VACATION
Where TempField2 = 0;

DROP Table VACATION;

View solution in original post

2 Replies
sunny_talwar

Try this

VACATION:
LOAD Code, 
     CodeID, 
     FieldDate, 
     Empname,
     Ceil(AutoNumber(RecNo(), Code&CodeID&Empname)/2) as TempField1,
     Mod(AutoNumber(RecNo(), Code&CodeID&Empname), 2) as TempField2
FROM [Temp.xlsx]
(ooxml, embedded labels, table is Sheet2);

FinalTable:
LOAD Code,
	 CodeID,
	 FieldDate as From,
	 Empname,
	 TempField1
Resident VACATION
Where TempField2 = 1;

Left Join (FinalTable)
LOAD Code,
	 CodeID,
	 FieldDate as To,
	 Empname,
	 TempField1
Resident VACATION
Where TempField2 = 0;

DROP Table VACATION;
d_koti24
Creator II
Creator II
Author

Thank you stalwar