Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Mattia
Creator II
Creator II

The syntax of the expression is correct?

Hi guys,

the syntax of the following expression in the script seems correct or no?

If(ApplyMap('KEY_TO_DISCIPLINA',[@10:17],'n/a')='35','ODONTO',
If([@4:9]='001880','DIALISI',
If(Match(ApplyMap('KEY_TO_NOTA',ApplyMap('DOUBLE_MAPPING',[@10:17],'n/a')),'IHca','MIHca'),'BOCA',
If(WildMatch(ApplyMap('KEY_TO_BS_STS21',ApplyMap('DOUBLE_MAPPING',[@10:17],'n/a')),'008'), If([@4:9]=030357,'PS_RADIO','RADIO'),
If(WildMatch(ApplyMap('KEY_TO_BS_STS21',ApplyMap('DOUBLE_MAPPING',[@10:17],'n/a')),'011'), If([@4:9]=030357,'PS_LAB','LAB'),
If(WildMatch(ApplyMap('KEY_TO_NOTA',ApplyMap('DOUBLE_MAPPING',[@10:17],'n/a')),'Ihmac'),'MAC',
If(Len(Trim([@10:17]))>0, If([@4:9]=030357,'PS_AMB','AMB')))))))) as TIPO

I ask this question because the sw don't show me some values (e.g. "PS_LAB", "PS_RADIO") and i don't know why.

In this records, the sw show me PS_AMB instead e.g. PS_LAB

Attached is a sample data file where the expression is the same (or no)?

Please, someone can help me?

Thanks,

Mattia

11 Replies
Frank_Hartmann
Master II
Master II

i cant see any attachments.... please reupload!

Mattia
Creator II
Creator II
Author

Sorry Frank!

Frank_Hartmann
Master II
Master II

cant see any issue.  PS_LAB and PS_RADIO in TIPO Field are present...

Unbenannt.png

 
 
Mattia
Creator II
Creator II
Author

Yes, Frank, ih this sample data file the fields are present.

But, in my original file the two fields are not present (in their place, i see PS_AMB).

Is so strange because, as you can see, the expression is the same.

The difference it could be caused by the formato of the data?

In the sample data file, the data are insert from a inline table, in my file from a txt.

Could i use other funcion such as len() or trim() or another ones?

Frank_Hartmann
Master II
Master II

hard to say without knowing the format of the rawdata fields. can u provide the txt file?

Mattia
Creator II
Creator II
Author

Here is attached a txt file with few records.

Frank_Hartmann
Master II
Master II

im not able to reproduce the issue with this shortened txt file. you should better prepare a sample qvw based on the txt file (maybe with different kind of dataset if your current dataset is sensitiv) showing the misbehaviour!

Mattia
Creator II
Creator II
Author

Ok, thanks Frank.

Next monday i'll prepare the sample data file and i'll share with you!

 

Mattia
Creator II
Creator II
Author

Hi Frank,

attached are sample data files.

As you can see, in the box "TIPO" there aren't "PS_LAB" and "PS_RADIO".

But, some records matches the expression in the query, e.g.

1) The 4th row (BS_STS21=008 and CODICE_PRESIDIO=030357), but in the field "TIPO" is PS_AMB instead of PS_RADIO;
2) The 19th row (BS_STS21=011 and CODICE_PRESIDIO=030357, but in the field "TIPO" is PS_AMB instead of PS_LAB.

Please, help me to find the problem!!!

Thanks,

Mattia