ApplyMap function in Qlikview

Hello there! In this Qlikview tutorial, I will show you how you can perform mapping load using the ApplyMap function.

For those of you who have missed my previous video blog post — showing basics of mapping load in Qlikview — I encourage you to view that video first since the intent of this blog post is to show you how to do a mapping load using the Applymap function, and some tips and tricks that you can incorporate in your next application.

I am using an example of a shoe manufacturing company, Vogue Shoes, selling its products through different major retailers.

Retailers get discount based on the sales volume, but the shoe company also offers promotional discount on products when it has excess inventory in order to promote sales.

We will use our new-found love for the mapping load in Qlikview to apply promotional discount when it exists. We will use nested applymap functions, and even show you how you can use it even in a calculation or an expression.

Let’s begin…

Step1:  Create a data set of a shoe company: Sales, Products, Customers, Discount.

Mapping Load 1

 

 

Mapping Load 5

 

 

Step 2:  Create a mapping tab in your script editor and add all the mappings.

Mapping Load in Qlikview

 

 

 Step 3:  Using ApplyMap() function, add new fields to the fact table.

 

Mapping Load 4

 

You can even take this to a step further by creating a variable for the discount and use it throughout your document, if you need to use this calculation repeatedly.

Elsewhere:

Loading a Mapping Table directly from a QVD via Qlikblog.at


If you enjoyed this article, get email updates (it’s free).

Email Address:

  • rajesh 1:27 pm on June 7, 2013 Permalink

    hi,

    Can you please help in this, when i use the applaymap function for ‘Product description and customername. i am not getting the complete data in ‘Product description and customername fileds.

    thanks
    rajesh

    • Shilpan 4:01 pm on June 7, 2013 Permalink

      Hi Rajesh,

      Plaese send me your qvw. Or, share your code in the comment section.

      Thanks,
      Shilpan

  • thirumala 11:37 am on June 21, 2013 Permalink

    plese send me any real time issues and some sample real time scripts because i am new in qlikview

  • Wee 2:17 am on July 9, 2014 Permalink

    Hi Shilpan, I am really new to the Qlikview and having trouble using Applymap when I tried to look up Fiscal Quarter and a vintage quarter for a product and use it in a calculation to determine whether the product falls in the new product released group within a 3 year window. I did the mapping scripts in the tab right next to main and have the rest of the calculation in a revenue tab.
    My mapping scripts look like this:
    //*****************************************************************************Mapping Table Calendar

    Calendar_Map:
    Mapping Load
    %Calendar_Id,
    Fiscal_Qtr

    FROM
    \\Master_Data\Calendar.QVD
    (qvd);

    //*****************************************************************************Mapping Vintage Qtr Calendar

    Vintage_Year_Qtr_Map:
    Mapping Load
    %Material_Id,
    Vintage_Year_Qtr

    FROM
    \\Master_Data\Material.QVD
    (qvd);

    The calculation looks like this:
    //*****************************************************************************New product revenue class
    CombinedRevenue:
    Load
    Applymap(‘Calendar_Map’, %Calendar_Id) as FiscalQtrReference,
    Applymap(‘Vintage_Year_Qtr_Map’,%Material_Id) as VintageQtrReference,
    if((FiscalQtrReference-VintageQtrReference)=0, ‘Yes’, ‘No’) as Rev_3YR_Window;

    Could you please help??
    Thanks in advance!
    Regards,
    Wee

    • Shilpan 3:52 am on July 10, 2014 Permalink

      Hi Wee,

      What is the issue?

      Thanks,
      Shilpan

  • Kadir 4:28 am on July 17, 2014 Permalink

    Hi Shilpan,

    Thanks for the great tutorial on ApplyMap – I now understand what it is, how it works and how we can integrate it to more complex matters seamlessly. I was following you on YouTube as well and great to come across with your website.

    Best wishes,

  • QlikView Mapping Load: Optimized or Un-optimized? « Learn Qlikview 2:45 am on April 7, 2015 Permalink

    […] Mapping Load in Qlikview: A Qlikview Tutorial […]

  • LivingQlik Roots: The Complete Guide to QlikView Mapping Load - Living Qlik 6:02 am on November 29, 2016 Permalink

    […] Learn QlikView – Mapping Load in QlikView: A QlikView Tutorial […]