Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

ApplyMap not working

I want to map months to quarters using this mapping table and this expression in my script: ApplyMap('MONTHQUARTER',MQLMONTHFINAL,'') where MONTHQUARTER is the name of the mapping table below. However, I keep getting blanks. Any idea what may be going wrong? The month abbreviations I am using in the mapping table are consistent with how months show up in the month field I am mapping to quarters. My guess there is some format issue (text vs. number) but I am lost. Thanks.

   

MQLMONTHFINALQuarter
JanQ1
FebQ1
MarQ1
AprQ2
MayQ2
JunQ2
JulQ3
AugQ3
SepQ3
OctQ4
NovQ4
DecQ4
7 Replies
agomes1971
Specialist II
Specialist II

Hi,

please see below:

quick applymap example

HTH

André Gomes

Anonymous
Not applicable
Author

Thanks, Andre. I am familiar with how ApplyMap works. I have been using it a lot. The syntax is clear to me. My challenge is that in this case it is not picking up any matches and just gives me blanks, which is odd.

agomes1971
Specialist II
Specialist II

I think the best for you to obtain some help was to put here a sample of your project.

Thanks

André Gomes

Colin-Albert

If you change your expression to ApplyMap('MONTHQUARTER',MQLMONTHFINAL) or add this as an extra test expression, then the apply map with the two parameters will show the values for MQLMONTHFINAL that are not mapping to MONTHQUARTER values.

It may be a data type issue especially if MQLMONTHFINAL was created using the month() function which returns a dual value. Testing with the two parameter applymap will show this.

The other gotcha is if you created the mapping table using "load" instead of "mapping load" - does the mapping table exist in the data model after the reload has finished?

Anonymous
Not applicable
Author

Colin, thanks. I did load as the mapping load but I think the data format is the issue as you suggested. I did in fact create MQLMONTHFINAL using the month () function. How do I solve that?

Colin-Albert

Try including a text function in your applymap.

ApplyMap('MONTHQUARTER', text(MQLMONTHFINAL), '')



Anonymous
Not applicable
Author

I will try. Thank you!