Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a field in excel which consists of values in DD-MM-YYYY hh:mm:ss TT Format.
I wish to find out the length of the number of characters present in the field value in the script.
e.g. if value is 12/12/2014 01:10:00 AM , then length should be 22.
Thanks,
Asma
Len('12/12/2014 01:10:00 AM')
What do you need this length for?
Maybe there are other possibilities than calculating the length of this string ...
regards
Marco
How do I calculate this length in the script?
If I use the expression len(fieldname), then it returns the number of characters present in the word fieldname. I want to calculate the length of field values in the backend
Hi,
USe
Len(Timestamp#(FieldName,'DD/MM/YYYY hh:mm:ss tt')) as Len_dateField
Regards
Marco is right and I can't possibly imagine which situation that will return the length of the word fieldname when you have the expression len(fieldname) - that is if fieldname has a value that is the same length as the word fieldname that could explain it.... len('fieldname') on the other hand should give the result you have.
Is it a Load Script you are referring to? A QlikView Load Script? Could you show us the part of the load script that fails? Where is the expression located in a Load statement or as an expression for a variable outside a load statement?
len(fieldname)
does not return the length of the word 'fieldname' but the length of the values of this field.
In the script
LOAD Len(yourfield) as YourFieldLength
FROM yoursource;
should work.
Do you have a example data?
regards
Marco
This is not working either.
If value is 3/1/2015 02:14:00 AM , it is returning length as 10 which is incorrect
If fieldvalue is '1/3/2015 02:04:50 AM', then it is returning length as 10 which is incorrect
please provide a sample of the excel source file and the part of your script that fails.
Maybe it's loading a numerical value from excel that is formatted as Timestamp in the script but len() counts the digits of the numerical representation or something like that.
regards
Marco