Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

String functions

I'm having data in this format

VC4

VC4-4c

VC4-16c

VC4-64c

but i want in this format

VC4c4

VC4c16

VC4c64

VC4c256

Please help

8 Replies
sudeepkm
Specialist III
Specialist III

Please take a look at the attachment.

MK_QSL
MVP
MVP

Use Replace Function in your script..

Load

     Replace(YourFieldName,'-','') as YourFieldName

From TableName;

Not applicable
Author

replace (Field,'-','') as NewField

regards,

MT

sunilkumarqv
Specialist II
Specialist II

Hi Shehal,


You can use Purgechar function anything that has to be take it off in your script '-'

so try like these

=purgechar ( Youfieldname,'-' )


For replace function works like below it good to use purgechar for best  optimization

replace('abccde','cc','xyz') returns 'abxyzde'

Not applicable
Author

but i dnt Vc44c i want Vc4c4 in this way others also

Not applicable
Author

Can you please elaborate a little bit more. The above example is different from your original example.

Can you create a table and put the two fields side by side with like 5,6 records as to how you want the result to be.

Anonymous
Not applicable
Author

use

if(index(ddd,'-')>0, subfield(ddd,'-',1)&right(subfield(ddd,'-',2),1)&left(subfield(ddd,'-',2),len(subfield(ddd,'-',2))-1),ddd) as d2

in your load statement in the example qvw above.

test-string.png

PrashantSangle

Hi Snehal Mejari,

You have write following expression in your script,

Subfield(Data,'-',1)&''&PurgeChar(SubField(Data,'-',2),'1234567890')&''&KeepChar(SubField(Data,'-',2),'1234567890')*4 as newData

Which give you required as you want .

For better understanding i am attaching sample QVW

Check this It will help you,

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂