Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
akpofureenughwu
Contributor III

Please explain this load statement

Hello sir,

I am trying to work on two tables that has unique dates. In my bid to sync both dates to become one, I got to this blog : https://community.qlik.com/docs/DOC-5834.

my tables are in the format:

Expenditure

     

Expenditure  DateLocationExpenditure ItemExpenditure Figure (Naira) PER Expenditure Figure (Naira) YTDExpenditure Figure (Naira) ITD
01/12/1999LagosCAPEX1,1841,184,485,207.691,184,485,207.69
01/12/1999LagosOPEX5,544,029,077.165,544,029,077.165,544,029,077.16
01/12/1999LagosRevenue000
01/12/1999Lagos
01/12/1999Lagos

Cash Call

      

Cash DateLocationPartnerEquityPER NGNYTD NGNITD NGN
01/12/1999LagosBarry55-3,450.00-3,450.00-3,450.00
01/12/1999LagosYoung45-1,607.00-1,607.00-1,607.00

My first question is

Please explain this load statement:

Orders:

LOAD *, 1 as OrderCounter INLINE [

OrderId, OrderDate, Quantity

1, 01/01/2012, 101

2, 01/01/2012, 102

3, 02/01/2012, 103

4, 03/01/2012, 104

5, 03/03/2012, 105

6, 03/04/2012, 106

]

;  I saw it from this blog https://community.qlik.com/docs/DOC-5834.

and

must I do it scripting for all columns on my tables above? 

see attached for clarity?

Regards

4 Replies
effinty2112
Honored Contributor

Re: Please explain this load statement

Hi Akpofure,

The script just adds a column called OrderCounter  with the single value of 1. The reason for this is to give a different way to count the number of orders, so instead of count(OrderId) use sum(OrderCounter). Some believe there is a performance improvement in doing it that way. I'm not so sure there is but it's easy to try it out.


If your second question asks if you need to do something like this when loading your tables then no is the answer.


Cheers


Andrew

akpofureenughwu
Contributor III

Re: Please explain this load statement

Thank you Andrew,

My second question is how will you add to an app that has two data sources (and you need to sync them to become one).

That's my second question?

effinty2112
Honored Contributor

Re: Please explain this load statement

Hi Akpofure,

There are many ways to add your two tables to QV. The simplest might be concatenation. In the script below I've changed the name of the two date fields to Date and added a new field to each called Transaction Type.

Transactions:

LOAD * , 'Expenditure' as [Transaction Type] INLINE [

    Date, Location, Expenditure Item, Expenditure Figure (Naira) PER, Expenditure Figure (Naira) YTD, Expenditure Figure (Naira) ITD

    01/12/1999, Lagos, CAPEX, "1,184", "1,184,485,207.69", "1,184,485,207.69"

    01/12/1999, Lagos, OPEX, "5,544,029,077.16", "5,544,029,077.16", "5,544,029,077.16"

    01/12/1999, Lagos, Revenue, 0, 0, 0

    01/12/1999, Lagos, , ,

    01/12/1999, Lagos

];

Concatenate (Transactions)

LOAD *  , 'Cash Call' as [Transaction Type] INLINE [

    Date, Location, Partner, Equity, PER NGN, YTD NGN, ITD NGN

    01/12/1999, Lagos, Barry, 55, "-3,450.00", "-3,450.00", "-3,450.00"

    01/12/1999, Lagos, Young, 45, "-1,607.00", "-1,607.00", "-1,607.00"

];

good luck

Andrew

akpofureenughwu
Contributor III

Re: Please explain this load statement

Hello Andrew,

Thanks,

Your suggestions is great but thats not what on my mind.

I want to merge just the two dates and make them one.  more like this : Date Combo

  Linking to two or more dates

Regards