Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

Create from one data-column two columns

Hi Folks,

 

i got a question regarding of creating of data-interval, i have the following example:

MyTable:

Employee, Occupation, Data

A,                 Junior,           01.01.2020

A,                 Senior,           15.08.2020

 

based on above example, i have a question. is that possible to create two Columns from one Column: Data

My expected output is:

Employee, Occupation,        Start,                   End

A,                 Junior,                01.01.2020             14.08.2020

A,                 Senior,                15.08.2020             30.09.2020 (Today)

 

Does anybody have any idea how to resolve this issue. Thanks a lot for any feedbacks.

Beck

                  

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Try this

Table:
LOAD * INLINE [
    Employee, Occupation, Data
    A, Junior, 01.01.2020
    A, Senior, 15.08.2020
];

FinalTable:
LOAD Employee,
	 Occupation,
	 Data as Start,
	 Date(If(Employee = Previous(Employee), Peek('Start')-1, Today())) as End
Resident Table
Order By Employee, Data desc;

DROP Table Table;

View solution in original post

2 Replies
sunny_talwar

Try this

Table:
LOAD * INLINE [
    Employee, Occupation, Data
    A, Junior, 01.01.2020
    A, Senior, 15.08.2020
];

FinalTable:
LOAD Employee,
	 Occupation,
	 Data as Start,
	 Date(If(Employee = Previous(Employee), Peek('Start')-1, Today())) as End
Resident Table
Order By Employee, Data desc;

DROP Table Table;
beck_bakytbek
Master
Master
Author

Sunny,

 

thanks a lot for your valuable time and attention