Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

drop first three digits

Is it possible to drop the first three digits in a name?

I need to drop the SQL in the data.

Field     LastModBy

Data      sqlrsmith

Data      sqljdoe

Data      sqlbjones

1 Solution

Accepted Solutions
dmitry909
New Contributor III

Re: drop first three digits

Example of correct code here:

Table1:

Field1,

Field2,

........,

right(LastModBy,len(LastModBy)-3) as LastModBy;

SQL Select

Field1,

Field2,

........,

LastModBy

From SourceTable;

9 Replies
dmitry909
New Contributor III

Re: drop first three digits

You can try:

replace(LastModBy,'sql','')

or

right(LastModBy,len(LastModBy)-3)

Re: drop first three digits

Sure, try this may be:

Right(LastModBy, Len(LastModBy) - 3)

Not applicable

Re: drop first three digits

dmitry909
New Contributor III

Re: drop first three digits

Try do this in Qlik part of Script (above SQL Select), not in SQL code.

Not applicable

Re: drop first three digits

still get error like above

dmitry909
New Contributor III

Re: drop first three digits

Example of correct code here:

Table1:

Field1,

Field2,

........,

right(LastModBy,len(LastModBy)-3) as LastModBy;

SQL Select

Field1,

Field2,

........,

LastModBy

From SourceTable;

Not applicable

Re: drop first three digits

Now my join does not work

dmitry909
New Contributor III

Re: drop first three digits

Use alias, your field in "Rxs" table must be named as "LastModBy", like in another table.


Try this:

right(LastModBy,len(LastModBy)-3) as LastModBy

robvanwun
New Contributor

Re: drop first three digits

I think u missed the rename "as LastModifiedBy" in table RXS