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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
chaitanyajami
Partner - Creator
Partner - Creator

apply map for fact details

hi,

actually i have order id,soap id,number of items sold ,year wise in ORDER table and soap id,cost in SOAP DETAILS table , now i want to derive a new field for number of items sold *  cost, i have used apply map to get cost column into my fact table(ORDER) but the multiplication is not working please help

MapOrdertoSoap:

mapping Load

[SOAP ID],

COST

from

(ooxml, embedded labels, table is [SOAP DETAILS]);

ORDERS:

LOAD ID as orderid,

     [SOAP ID],

     [CITY ID],

     [NO OF ITEMS SOLD],

     [SALE YEAR],

     ApplyMap('MapOrdertoSoap','[SOAP ID]','NO DATA') as COST,

     [NO OF ITEMS SOLD] * COST as [ORDER AMOUNT]

     FROM

     (ooxml, embedded labels, header is 2 lines, table is ORDERS);

1 Solution

Accepted Solutions
sunny_talwar

[SOAP ID] doesn't need single quotes around it and you would need to put the ORDER AMOUNT calculation in a preceding load. Try this:

MapOrdertoSoap:

mapping Load

[SOAP ID],

COST

from

(ooxml, embedded labels, table is [SOAP DETAILS]);

ORDERS:

LOAD *,

          [NO OF ITEMS SOLD] * COST as [ORDER AMOUNT];

LOAD ID as orderid,

     [SOAP ID],

     [CITY ID],

     [NO OF ITEMS SOLD],

     [SALE YEAR],

    ApplyMap('MapOrdertoSoap', [SOAP ID],'NO DATA') as COST

     FROM

     (ooxml, embedded labels, header is 2 lines, table is ORDERS);

View solution in original post

3 Replies
sunny_talwar

[SOAP ID] doesn't need single quotes around it and you would need to put the ORDER AMOUNT calculation in a preceding load. Try this:

MapOrdertoSoap:

mapping Load

[SOAP ID],

COST

from

(ooxml, embedded labels, table is [SOAP DETAILS]);

ORDERS:

LOAD *,

          [NO OF ITEMS SOLD] * COST as [ORDER AMOUNT];

LOAD ID as orderid,

     [SOAP ID],

     [CITY ID],

     [NO OF ITEMS SOLD],

     [SALE YEAR],

    ApplyMap('MapOrdertoSoap', [SOAP ID],'NO DATA') as COST

     FROM

     (ooxml, embedded labels, header is 2 lines, table is ORDERS);

chaitanyajami
Partner - Creator
Partner - Creator
Author

Hi Sunny,

Thanks a lot, its working fine.

sunny_talwar

Awesome