Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Mattia
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
Vegar
MVP
MVP

Try

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

View solution in original post

2 Replies
Vegar
MVP
MVP

Try

If(
  [@276:276]='S', 
  If(  
    match( ApplyMap('KEY_TO_CODICE_PRESTAZIONE',[@10:17],'n/a'), 
           '87371','87372'
         ),
    'SCREENING',
    'BDG'
  ) as [New field]
Mattia
Creator II
Creator II
Author

Many thanks, Vegar!

Your solution runs perfectly!

Mattia