Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
clsaulsberry
Contributor III
Contributor III

writing starts with in the script

i am new to qlikview and I am trying to create a field from another field that says  if this field starts with "2" then display the information as is but if not only show the first 12 characters.

any advice please

1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

One way is as below:

Data:
Load * Inline [
ID,Type
10,2 First Record data
20,Second record sample data
30,Third record sample data
40,2 Fourth Record Data
50,Fifth record sample data
]
;

SourceData:
Load ID,
If(Left(Type,1)=2,Type,Left(Type,12)) as Type
Resident Data;

View solution in original post

3 Replies
trdandamudi
Master II
Master II

One way is as below:

Data:
Load * Inline [
ID,Type
10,2 First Record data
20,Second record sample data
30,Third record sample data
40,2 Fourth Record Data
50,Fifth record sample data
]
;

SourceData:
Load ID,
If(Left(Type,1)=2,Type,Left(Type,12)) as Type
Resident Data;

clsaulsberry
Contributor III
Contributor III
Author

Thank you

trdandamudi
Master II
Master II

You are welcome...