Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

concat problem in script

Hi Geniuses,

When I am concatenating 20 with one column it gave me wrong result. Below is the script

LOAD 

    '20' & Right([Fiscal Year],2) AS FY ,

     [Fiscal Year]

FROM

[..\..\QVD_DATA\ETG\S_E_Bookings.qvd]

(qvd)

where Fiscal Year is FY10, FY11,FY12,FY13

The desired result is 2010,2011,2012,2013

Result which I am Getting 20,2010,2011,2012,2013

I want to remove that unwanted 20

Thanks in advance

S

1 Solution

Accepted Solutions
swuehl
MVP
MVP

What is the Fiscal Year value for the record you get 20 in FY (just select 20 in FY and look at the other field)?

I assume it's NULL.

You can check for NULL like

LOAD 

    if(len(trim([Fiscal Year])), '20' & Right([Fiscal Year],2) ) AS FY ,

     [Fiscal Year]

FROM

[..\..\QVD_DATA\ETG\S_E_Bookings.qvd]

(qvd)

View solution in original post

4 Replies
swuehl
MVP
MVP

What is the Fiscal Year value for the record you get 20 in FY (just select 20 in FY and look at the other field)?

I assume it's NULL.

You can check for NULL like

LOAD 

    if(len(trim([Fiscal Year])), '20' & Right([Fiscal Year],2) ) AS FY ,

     [Fiscal Year]

FROM

[..\..\QVD_DATA\ETG\S_E_Bookings.qvd]

(qvd)

Clever_Anjos
Employee
Employee

It seems you have one (or more) record with NULL into [Fiscal Year] field

Not applicable
Author

Hi,

Check out the Solution given in the below file

Nothing Changes required.

hope it helps you.

Regards,

Ravikant

Anonymous
Not applicable
Author

Thanks a lot swehl, it worked