Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

How can i correct this expression in the script?

Hi QV users,

i've a problem with the following expressions in the script:

KEY_TO_CODICE_PRESTAZIONE:
Mapping LOAD
[@10:17] as CONTATORE_PRESCRIZIONE,
[@29:33] as CODICE_PRESTAZIONE

1) If([@276:276]='S', If(ApplyMap('KEY_TO_CODICE_PRESTAZIONE',[@10:17],'n/a')='87371','SCREENING','BDG') as new field

it works perfectly: if the field [@276:276] contains the letter "S" and the field [@29:33] contains the value "87371", the new field show me "SCREENING", otherwise "BDG" (if the field [@29:33] not contains the value "87371").

2) If([@276:276]='S', If(ApplyMap('KEY_TO_CODICE_PRESTAZIONE',[@10:17],'n/a')='87371'or'87372','SCREENING','BDG') as new field

don't work: my real goal is that if the field [@276:276] contains the letter "S" and the field [@29:33] contains the value "87371" or the value "87372", the new field must show me "SCREENING", otherwise "BDG" (if the field [@29:33] not contains the value "87371" or the value "87372").

Please, can someone show me the right direction?

Thanks,

Mattia

Labels (2)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Try

If(
  [@276:276]='S', 
  If(  
    match( ApplyMap('KEY_TO_CODICE_PRESTAZIONE',[@10:17],'n/a'), 
           '87371','87372'
         ),
    'SCREENING',
    'BDG'
  ) as [New field]
Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

2 Replies
Highlighted
Partner
Partner

Try

If(
  [@276:276]='S', 
  If(  
    match( ApplyMap('KEY_TO_CODICE_PRESTAZIONE',[@10:17],'n/a'), 
           '87371','87372'
         ),
    'SCREENING',
    'BDG'
  ) as [New field]
Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

Highlighted
Creator II
Creator II

Many thanks, Vegar!

Your solution runs perfectly!

Mattia