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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Code Explanation

Hi All,


Can someone explain the below code.


WBS_Des_MAP:

Mapping

LOAD ID as WBS_Element,

    if(WildMatch([FINAL WBS],'*-'),Replace([FINAL WBS],'-',''),[FINAL WBS]) as WBS_Element_Des

FROM

[..\10_data_sources\Excel\WBS MASTER-FINAL-CASHFLOW.xlsx]

(ooxml, embedded labels, table is DETAILS);

WBS_Des_MAP2:

Mapping

LOAD

    [FINAL WBS],

    F3

FROM

[..\10_data_sources\Excel\WBS MASTER-FINAL-CASHFLOW.xlsx]

(ooxml, embedded labels, table is [GROUP DESCR]);

WBS_Group_Des:

LOAD

    [FINAL WBS] as WBS_Code,

    F3,

    Descr

FROM

[..\10_data_sources\Excel\WBS MASTER-FINAL-CASHFLOW.xlsx]

(ooxml, embedded labels, table is [GROUP DESCR]);

AssignmentToWBSMap:

Mapping

LOAD Co.code,

    if(len(trim([WBS Element]))>0,[WBS Element],

    if(Len(Assignment)>=6,Assignment,H.Text)) as WBS_Code_Final

FROM

[..\10_data_sources\Excel\cashflow-*.csv]

(txt, codepage is 1252, embedded labels, delimiter is '\t', no quotes, no

eof);



LOAD

    'Current' as Cashflow_Period_Type,

    if(ApplyMap('WBS_Des_MAP', [WBS Element],0)<>0, [WBS Element],

    if(ApplyMap('WBS_Des_MAP',Assignment,0)<>0,Assignment,

    if(ApplyMap('WBS_Des_MAP', H.Text,0)<>0, H.Text,

    if(ApplyMap('WBS_Des_MAP',[Project Code],0)<>0,[Project Code],

    'C1000'

    ))))   

      as WBS_Final_Code,

      ApplyMap('AssignmentToWBSMap',Co.code,0) as WBS_Final_code,

    H.Text as Header_Text   

    Resident OutFlowData;

Regards,

Keerthi KS

13 Replies
sunny_talwar

Are you saying that you want to use Join instead of Mapping/ApplyMap method to achieve the same result as your original code???

Not applicable
Author

Yes to join both tables

sunny_talwar

Need to see your script for OutFlowData to give better direction.

Not applicable
Author

OutFlowData:

LOAD Co.code,

     V.Code,

     V.Name,

     [Doc. Type],

     [Payment Doc No],

     [Line Item No],

     [Payment Date],

     [Spl G/LAcc],

     [Paid amt],

     [TDS Amt],

     [Paid Amt+TDS],

     [Line Item Amt],

     [Inv Doc No],

     Year,

     [Bill No],

     [Inv Date],

     [Source Doc.Type],

     [Inv Posting Date],

     [Inv Amt],

     Curr.,

     [PO No],

     [PO Item No],

     [PO Date],

     [PO Value],

     [Service Activity],

     [Activity Short Text],

     Mat.Code,

     Mat.Desc,

     [WBS Element],

     Assignment,

     [Network Activity],

     [Internal Order],

     [Project Code],

     [Project Name],

     [Payment Method],

     [Payment Ref.No],

     [Cheque Date],

     H.Text,

     [G/L Acc.],

     [G/L Desc.],

     [Payee Bank],

     [Name of Bank],

     Cl.Doc.No,

     Cl.Date

FROM

[..\10_data_sources\Excel\cashflow-*.csv]

(txt, codepage is 1252, embedded labels, delimiter is '\t', no quotes, no

eof);