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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Mattia
Creator II
Creator II

How to write an expression with applymap

Hi Guys,

i need to write an expression in the script with the following output: when the field [@29:33] =35, the new field TIPO must show "ODONTO". The field [@29:33] is in table "D" while the field [@10:17] is the key between table "T" and "D".

I've tried with:

KEY_TO_UO_RIFERIMENTO:
Mapping LOAD
[@10:17] as CONTATORE_PRESCRIZIONE,
[@29:33] as UO_RIFERIMENTO

If(ApplyMap('KEY_TO_UO_RIFERIMENTO',[@10:17],'n/a')=35,'ODONTO') as TIPO

but don't work.

Can anyone help me?

Thanks,

Mattia

Labels (3)
1 Solution

Accepted Solutions
Mattia
Creator II
Creator II
Author

Sorry, Sunny, you're right.

Anyway, you've helped me, because while i'd creating a data sample file, i understand how to solve the problem!

I hope you can help me in the next topics.

Mattia 

View solution in original post

4 Replies
sunny_talwar
MVP
MVP

Don't see any issues... can you mock up the problem in a sample mocked up data for us to see?

Mattia
Creator II
Creator II
Author

Now it's difficult because i've a lot of data and i can't show them.

The script is the following:

KEY_TO_UO_RIFERIMENTO:
Mapping LOAD
[@10:17] as CONTATORE_PRESCRIZIONE,
[@29:33] as UO_RIFERIMENTO

FROM...

If(ApplyMap('KEY_TO_UO_RIFERIMENTO',[@10:17],'n/a')='35','ODONTO'),
If([@4:9]='001880','DIALISI', If(WildMatch([@10:17],'L*'),'LAB', If(Len(Trim([@10:17]))>0, If([@4:9]='030357','PS_AMB','AMB')))) as TIPO

After the reload, QV show me only "LAB" and "AMB" and i don't know why.

Also, between available fields, i've @10:17...

sunny_talwar
MVP
MVP

All I am asking for is to mock up 5-10 rows of data just like I did here What's wrong in this script? . If you are unable to do this... then I am cannot really spare time each time to create a mock up for you.

Best,
Sunny

P.S. Mock up doesn't need actual data... it can be data which doesn't make sense, but still shows the issue.

Mattia
Creator II
Creator II
Author

Sorry, Sunny, you're right.

Anyway, you've helped me, because while i'd creating a data sample file, i understand how to solve the problem!

I hope you can help me in the next topics.

Mattia