Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
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
jaibau1993
Partner - Creator III
Partner - Creator III

Hi Mattia:

The "4th row" you pointed can never have "PS_RADIO" as value of the field TIPO. I tell you why:

  1. This "4th row" corresponds to the first row of the txt file "Sample data_T"
  2. [@10:17] (CONTATORE_PRESCRIZIONE) has the value "PS6742"
  3. The MAP ApplyMap('DOUBLE_MAPPING',[@10:17],'n/a') returns 897B7
  4. The double MAP ApplyMap('KEY_TO_BS_STS21',ApplyMap('DOUBLE_MAPPING',[@10:17],'n/a')) returns 019
  5. Since PS_RADIO and RADIO are the labels asigned when the previous double MAP returns 008, this row has not PS_RADIO as TIPO and has PS_AMB instead

So, what is wrong? I can not tell you because I don't know the logic of the problem but you should:

  1. Check both MAPs in the double MAP: maybe they are not working as you espect
  2. Check the TIPO field logic

Hope this helps! Regards,

Jaime.

Mattia
Creator II
Creator II
Author

Hi Jaibau,

thank you very much for the detailed reply.

I've already solved my problem by using Left Join() because, in fact, ApplyMap() don't work and don't show me the output i want.

Mattia