Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Arunesh_Saravanan
Contributor II
Contributor II

find the substring and to store the same substring value in new column.

Hi guys,

I need to find the substring from the table column and to store the same substring value in new column.

I do no how to raise the question.

if the Label Column as a value like below pic.

Arunesh_Saravanan_0-1723796801866.png 

I need to find the value "Prd", "dev " and if it is "Prd" then Prd should be stored in new column as Instance. same like if it is "dev" then dev value should be stored in the same column as Instance. I need the script to run in data load editor. so that the table should be visible like below,

Labels                        Instance

["default","Prd"]             Prd

["Prd","default"]             Prd

["default","dev"]             dev

["default"]                       undefined

 

Is it make any sense? Kindly give any ideas or your thoughts/opinion on this.

Thanks.

1 Solution

Accepted Solutions
Kushal_Chawda

@Arunesh_Saravanan  If you know the exact value of string to be searched then you can try something like below

if(SubStringCount(Labels,'Prd'),'Prd',
if(SubStringCount(Labels,'dev'),'dev','undefined')) as Instance 

View solution in original post

3 Replies
Kushal_Chawda

@Arunesh_Saravanan  If you know the exact value of string to be searched then you can try something like below

if(SubStringCount(Labels,'Prd'),'Prd',
if(SubStringCount(Labels,'dev'),'dev','undefined')) as Instance 

Arunesh_Saravanan
Contributor II
Contributor II
Author

Super bro. Its working... Thanks.

and also, i had another doubt. I want to know how to extract the substring data with values and need to store the value in new column. In this case, I don't know the exact value of the string.

For example, Below column contains so many values in the string. But I need only Job_type, schema and frequency hour. This substring contains value so that i need to find those substrings and need to store those value in a new column.

Arunesh_Saravanan_0-1723811395023.png

so, the answer should be like below and unknown values should be Blank.

 

Could you suggest any idea for this?

 

 

 

Arunesh_Saravanan
Contributor II
Contributor II
Author

Super bro. Its working... Thanks.

and also, i had another doubt. I want to know how to extract the substring data with values and need to store the value in new column. In this case, I don't know the exact value of the string.

For example, Below column contains so many values in the string. But I need only Job_type, schema and frequency hour. This substring contains value so that i need to find those substrings and need to store those value in a new column.

Arunesh_Saravanan_0-1723812077819.png

 

so, the answer should be like below and unknown values should be Blank.

Arunesh_Saravanan_1-1723812087908.png

Could you suggest any idea for this?