Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Qlik Scripting Issue

Hi, so I was wondering if anyone could provide an idea of how to implement the following in qlikview?

IF brackets in value string, then create a subfield of string within the brackets AS newValue

ELSE create a subfield of 1st 4 characters in value string AS newValue

Thanks, Ben

1 Solution

Accepted Solutions

Re: Qlik Scripting Issue

May be like this:

If(Index(string, '(') and Index(string, ')'), TextBetween(String, '(', ')'), Left(String, 4)) as NewValue


Update: Missed a parenthesis

2 Replies

Re: Qlik Scripting Issue

May be like this:

If(Index(string, '(') and Index(string, ')'), TextBetween(String, '(', ')'), Left(String, 4)) as NewValue


Update: Missed a parenthesis

vishsaggi
Esteemed Contributor III

Re: Qlik Scripting Issue

Can you post some sample data and expected output if possible??

Community Browser