Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Index Error

Hi all,

What I'm trying to do is:

If the 3 first character of H_SUPPLIERID1 = ‘FOU’ then H_SUPPLIERID1 else H_SUPPLIERID1 without the 3 first character

Ex : If ‘FOU_105758’ then ‘FOU_105758’

       If ‘55_FOU_105758’ then ‘FOU_105758’

my code:

SQL SELECT

  (H_CODE_SOCIETE) + '_' + (H_SUPPLIERID1) as CSUSUPID,

  (H_CODE_SOCIETE) + '_' + (H_CODE_SECTEUR) as IDCAPLAN,

  case when index(mid([H_SUPPLIERID1],3,1) '_')=0 then [H_SUPPLIERID1] else mid([H_SUPPLIERID1], 3) end as [SupplierId]

FROM SHARE.dbo.IDX;

The error message says there maybe a "with" or parenthesis missing with the index function.

I'd be greaful for any help.

Many thanks,

Florian

1 Solution

Accepted Solutions
senpradip007
Valued Contributor III

Re: Index Error

Try like

Load

If(Left(H_SUPPLIERID1,3) = 'FOU', H_SUPPLIERID1, Mid(H_SUPPLIERID1,4)) AS H_SUPPLIERID1,

...

;

SQL Select * from [Table name];

1 Reply
senpradip007
Valued Contributor III

Re: Index Error

Try like

Load

If(Left(H_SUPPLIERID1,3) = 'FOU', H_SUPPLIERID1, Mid(H_SUPPLIERID1,4)) AS H_SUPPLIERID1,

...

;

SQL Select * from [Table name];

Community Browser