Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Contributor III
Contributor III

Example of correct code here:

Table1:

Field1,

Field2,

........,

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

SQL Select

Field1,

Field2,

........,

LastModBy

From SourceTable;

View solution in original post

9 Replies
dmitry909
Contributor III
Contributor III

You can try:

replace(LastModBy,'sql','')

or

right(LastModBy,len(LastModBy)-3)

sunny_talwar

Sure, try this may be:

Right(LastModBy, Len(LastModBy) - 3)

Not applicable
Author

dmitry909
Contributor III
Contributor III

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

Not applicable
Author

still get error like above

dmitry909
Contributor III
Contributor III

Example of correct code here:

Table1:

Field1,

Field2,

........,

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

SQL Select

Field1,

Field2,

........,

LastModBy

From SourceTable;

Not applicable
Author

Now my join does not work

dmitry909
Contributor III
Contributor III

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
Contributor
Contributor

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