Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
nima94
Contributor III
Contributor III

change batch of series name in cloum

hi

i have a column which includes of series of voucher code as bellow:

cash voucher #2011

cash voucher #2012

cash voucher #2036

 

 

cash voucher #3020

cash voucher #3036

 

and many for #50** #60**

 

and also welcome25 and many other voucher name

 

now i want to transfer all of those cash series which starts with : cash voucher #20** to: cash#20 all 30** series to : cash#30 and same for the rest and still show other voucher name as well in the column such as welcom25.

can one one help me please ?

 

pleases find the attachment.

1 Solution

Accepted Solutions
Kushal_Chawda

@nima94  Assuming that the format of your voucher values are exactly same as attached image then you can try below. It will work for all other like #60 .. 

Data:
LOAD *,
     if(index(lower(trim(Voucher)),'cash voucher #cv'),
     'CASH '&right(mid(Voucher,index(Voucher,'#')+1,4),2),
     Voucher) as Voucher_New
 Inline [
Voucher
CASH VOUCHER #CV2030
CASH VOUCHER #CV2061
CASH VOUCHER #CV20**
CASH VOUCHER #CV3030
CASH VOUCHER #CV3061
CASH VOUCHER #CV30**
CASH VOUCHER #CV5030
CASH VOUCHER #CV5061
WELCOME 25
SUMMER VOUCHER
EOM VOUCHER ];

 

Annotation 2020-09-05 221815.png

 

View solution in original post

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Can you share some sample data with all scenarios you want to capture.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
nima94
Contributor III
Contributor III
Author

Hi thanks for your replay 

please find the attached image.

Kushal_Chawda

@nima94  Assuming that the format of your voucher values are exactly same as attached image then you can try below. It will work for all other like #60 .. 

Data:
LOAD *,
     if(index(lower(trim(Voucher)),'cash voucher #cv'),
     'CASH '&right(mid(Voucher,index(Voucher,'#')+1,4),2),
     Voucher) as Voucher_New
 Inline [
Voucher
CASH VOUCHER #CV2030
CASH VOUCHER #CV2061
CASH VOUCHER #CV20**
CASH VOUCHER #CV3030
CASH VOUCHER #CV3061
CASH VOUCHER #CV30**
CASH VOUCHER #CV5030
CASH VOUCHER #CV5061
WELCOME 25
SUMMER VOUCHER
EOM VOUCHER ];

 

Annotation 2020-09-05 221815.png

 

nima94
Contributor III
Contributor III
Author

Many Thanks.

i did till

Data:
LOAD *,
     if(index(lower(trim(Voucher)),'cash voucher #cv'),
     'CASH '&right(mid(Voucher,index(Voucher,'#')+1,4),2),
     Voucher) as Voucher_New

Here

And It works.