Hi, I have a formula to make the Title of a...

(Benoit Gramond) #1


I have a formula to make the Title of a packing list.

The title must begin wit the date with a forma YYYY-MM-DD

I used CONCATENATE because the titles tkes the infos from 4 columns.

concatenate(YEAR([sending_date]),’-’,if(LEN(MONTH([sending_date]))>1,MONTH([sending_date]),CONCATENATE(0,MONTH([sending_date]))),’-’,if(LEN(DAY([sending_date]))>1,DAY([sending_date]),DAY(0,DAY([sending_date]))),’ - ‘,[transport_type],’ ‘,[cubic_meters],’ cbm ‘,[total_ctns],’ ctn ',[packing_type])

It gave me the error message “LEN function is used incorrectly” DO you have an idea of how I should do ?

(Levent KULAÇOĞLU) #2


CONCATENATE(YEAR([sending_date]),"-",IFS(MONTH([sending_date])<10,“0”),MONTH([sending_date]),"-",IFS(DAY([sending_date])<10,“0”),DAY([sending_date]),"-",[transport_type],"-",[cubic_meters]," cbm “,[total_ctns],” ctn ",[packing_type])

(Yılmaz Kandiş) #3

I guess it is because;

LEN(text-expression) returns the length of text-expression. Your value within the LEN is number-expression not text.

DAY([date]) returns a number type not text.

(Benoit Gramond) #4

@Levent_KULACOGLU Thanks! I should have thought about this :smiley:

(Benoit Gramond) #5

@Yilmaz_Kandis1 Thanks a lot, I get it now. if I wanted to use LEN I needed to set my result in text with another formula I guess.