Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can I change a record in a field during the Load process

Hi All,


I have a table which has a field called Forecast Version. The Forecast Version field  contains three records which have the following name structure 'POR 2H13'. Is it possible to rename the recodr name during a load so that, for example, POR 2H13 becomes POR2H13?

Cheers,

John

1 Solution

Accepted Solutions
Not applicable
Author

Hi John

this solution is for field name not for content

you must use

trim(ForecastVersion)   as ForeCastVersion

or purgechar(ForeCastVersion,' ')  as ForeCastVersion

best regards

chris

View solution in original post

8 Replies
jvitantonio
Specialist III
Specialist III

swuehl
MVP
MVP

Yes, that should be possible, for example like

LOAD

     if([Forecast Version] = 'POR 2H12','POR2H13', [Forecast Version]) as [ForecastVersion],

     ...

FROM ...;

or

LOAD

     purgechar([Forecast Version], ' ') as [ForecastVersion],

     ...

FROM ..;

Not applicable
Author

Hi John

if POR 2H13 is the field name then use

LOAD

"POR 2H13" as POR2H13

if POR 2H13 is the content then use

LOAD

trim(fieldname)     as fieldname

best regards

chris

Not applicable
Author

Hi Guys

My Load statement looks like this

FACTS:

Load

Data,

ForecastVersion,

Market,

Printer,

Measure,

Technology,

Geography,

ShipDate,

Date(Date# (ShipDate , 'YYYYMM'),'MMM-YY') as Date

VersionData:
LOAD Distinct
ForecastVersion
RESIDENT FACTS;


THe content of ForecastVersion is

Current

POR 1H13

POR 2H13

I wan t to cahnge this to (spaces removed) :

Current

POR1H13

POR2H13

The solution suggested does not work:

LOAD

"POR 2H13" as POR2H13

Qlikview sees this as a load from my source data. Can you help me in understanding how to incorporate the code into the script correctly please?

Not applicable
Author

Hi ,

  Use the code as below in the load statement .



PurgeChar(ForecastVersion,' ') as ForecastVersion

Regards

Yusuf

Not applicable
Author

Hi John

this solution is for field name not for content

you must use

trim(ForecastVersion)   as ForeCastVersion

or purgechar(ForeCastVersion,' ')  as ForeCastVersion

best regards

chris

Not applicable
Author

Hi ,

  You can Use this code aslo in the load statement .

Replace(ForecastVersion,' ','') as [ForecastVersion]

here in bracket after FieldName 2 nd Paramater (' ') one space is there and 3 rd Paramater ('') no space is there.

Regards,

Ravikant.

Not applicable
Author

HI All,

Thanks so much for the very helpful and quick replies. It's great to see that the solutions are simple and straightforward. I'm lerarning all the time