Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 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 |
Cash Call
Cash 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 |
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
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
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?
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
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
Regards