In one of my mashdata, the XL file read is a parameter. I don't think that's very important to understand, but just in case... The columns are the same in all these excel files.
Nevertheless, I think it should be the same behaviour with only one XL file in which, sometime there are some empty values in a date column.
Depending on missing value, the date column is considered as text or date.
My objective is to add a column to determine if we are late and if yes, how many days. (it would be enough to know if we are late or not I think).
Any idea ?
I found how to calculate a difference of days between too dates (by changing the type and using an arythmetic component). But I am blocked with the treatment of the empty values :
- if I know that the type of the date will be text, I have a workaround but then, the replace function Iuse does not work when the column will be considered as a date.
- if I know that the type will be date it works but when it is consider as text, it does not.
What is the best solution to manage the empty fields ?
Laurent



Thomas Staub on
Hello Laurent
I have no idea why empty cells in a date-column can lead to different column-types while execution. That shold only happens while definition time (in Feededitor)!
But i think you have possibilities to handle the problem.
First you can define this column as textcolumn! In the Excel-Source-Operator you can push the "Configure column" button. In this dialog you can select the checkbox "Type as text"!
Then you can change the columntype to date (change columntype-operator). At this point the columntype shold allways be DATE!
Before you calculate the time-difference you shold remove the empty cells. That you can do with the filter-operator ("let values pass" if "is not empty"). If you need all rows you can split the dataflow (Data feeds->copy) before the filteroperator and join (Data feeds->combine) the two flows after the calculation of the difference.
I hope whith this proposals you can reach your objective.
Thomas