Skip to main content
Hi all,

 

 

In the middel of a workbench I want to do some kind of schema check for my 100+ attributes:

 

All values of attribute 1 are composed out of less than 255 charachters

 

All values of attribute 2 are composed out of less than 50 charachters

 

All values of attribute 3 are integers out of maximum 10 numbers

 

All values of attribute 4 are decimals with maximum 10 numbers before and 3 after the decimal seperator

 

All values of attribute 1 are dates

 

...

 

 

For the charachter fields I can work easily with the StringLengthCalculator and statistics calculator. But the number and date fields are a bit less easy.

 

 

For the number fieds I split them at the decimal seperator and check the length of the first and last part and with a StringSearcher I check if there are only numbers.

 

 

For the date field I split it up by day - month - year and check if the value is below 12, 31 or 9999

 

 

This all seems a bit "dumb". Is there some kind of intellegent way to check type and structure of each attribute value in the middel of the workbench? Some kind of schema checker?

 

 

Thx,

 

Rob

 

Hi,

 

 

StringSearcher with a little complex regular expression would be available for both of number and date fields. e.g. For decimal field, maximum 10 digits (including - mark) before dot and maximum 3 digits after dot: ^(-(0-9]{1,9}|}0-9]{1,10})(\\.\0-9]{0,3})?$   For YYYY-MM-DD form date field: ^( 0-9]{4})-(0-1-9]|1]0-2])-(0-1-9]|(1|2)|0-9]|3(0|1))$   These expressions are only for samples. Since I didn't test enough, please test well when you use them. And you can see more information about regular expressions here. http://www.regular-expressions.info/  
Postscript, Although StringSearcher would be available, checking 100+ attributes one by one may cause too complicated workspace. How about using Python script instead of putting many StringSearcher on the canvas? A sample: https://www.dropbox.com/s/cnqz3z5vhwpyyyf/130104CheckDataType.fmw

Hi @takashi unfortunately, this link is not valid anymore... By any chance would you still have that script somewhere? I'm experiencing the same problem and I'm pretty sure Python is the key...

Thanks in advance, cheers!


Hi @takashi unfortunately, this link is not valid anymore... By any chance would you still have that script somewhere? I'm experiencing the same problem and I'm pretty sure Python is the key...

Thanks in advance, cheers!

 

Using an attribute validator is a possibility now

Reply