Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

Not applicable

Can I apply a string function to a field I get via a SQL select statement

newbie question here I'm sure:

I need to clean up a text string that is retrieved as a field from a SQL Select statement so that I can join it to another field loaded from a Table file. I am trying to avoid having to do multiple replace() functions in my select statement and was hoping to rely on the allow() function in QlikView. So, is it possible to update the value of a field that is loaded via SQL select and if so how.

Ideally I'd be able to do something like:

ODBC CONNECT TO SOME_DB;

LET DNIS = string.allow(SOME_DB.DNIS,'0123456789');

SQL SELECT ..., phone_home as DNIS... FROM SOME_DB.leads where deleted <> 1;

so that the field DNIS now only includes numeric characters.

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Can I apply a string function to a field I get via a SQL select statement

I would suggest you make this kind of cleaning a preceeding load:

ODBC CONNECT TO SOME_DB;

Load keepchar(DNIS, '0123456789') as DNIS;

SQL SELECT ..., phone_home as DNIS... FROM SOME_DB.leads where deleted <> 1;

- Marcus

View solution in original post

4 Replies
MVP & Luminary
MVP & Luminary

Re: Can I apply a string function to a field I get via a SQL select statement

I would suggest you make this kind of cleaning a preceeding load:

ODBC CONNECT TO SOME_DB;

Load keepchar(DNIS, '0123456789') as DNIS;

SQL SELECT ..., phone_home as DNIS... FROM SOME_DB.leads where deleted <> 1;

- Marcus

View solution in original post

Not applicable

Re: Can I apply a string function to a field I get via a SQL select statement

Marcus,

thank you. That worked exactly as expected.

Regards,

Paul

Highlighted
meet_purushu
New Contributor III

Re: Can I apply a string function to a field I get via a SQL select statement

@Paul; You should mark Marcus succession as answer.

@Marcus; that was helpful suggestion

Not applicable

Re: Can I apply a string function to a field I get via a SQL select statement

Thank you.