Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys.
I have created a table as such:
Table:
CrossTable(Month, Data, 14)
LOAD * FROM
$(vFile)
(qvd);
But, i still want to add in another 2 more new field/column .Startdate and EndDate.
How to add it to this Table?
Rgds,
Jim
Do you want the new columns to be included Under Month and Data ??
if yes then load this way
Table:
CrossTable(Month, Data, 14)
LOAD * ,
num(Date#($(vStart),'YYYYMMDD')) as StartDate,
null()as EndDate
FROM
$(vFile)
(qvd);
//If you don't need to include then try like this
Table:
CrossTable(Month, Data, 16)
LOAD
num(Date#($(vStart),'YYYYMMDD')) as StartDate,
null()as EndDate,
*
FROM
$(vFile)
(qvd);
Hi Jim, Can you please share a sample?
the above line my sample of code already. Can I do it this way?
Table:
CrossTable(Month, Data, 14)
LOAD * ,
num(Date#($(vStart),'YYYYMMDD')) as StartDate,
null()as EndDate
FROM
$(vFile)
(qvd);
Please try this preceding load.
table:
load
num(Date#($(vStart),'YYYYMMDD')) as StartDate,
null()as EndDate, *;
CrossTable(Month, Data, 14)
LOAD * ,
num(Date#($(vStart),'YYYYMMDD')) as StartDate,
null()as EndDate
FROM
$(vFile)
(qvd);
May be this:
Table:
CrossTable(Month, Data, 16)
LOAD
num(Date#($(vStart),'YYYYMMDD')) as StartDate,
null()as EndDate,
* // new fields have to come before '*' in the load
FROM
$(vFile)
(qvd);
Do you want the new columns to be included Under Month and Data ??
if yes then load this way
Table:
CrossTable(Month, Data, 14)
LOAD * ,
num(Date#($(vStart),'YYYYMMDD')) as StartDate,
null()as EndDate
FROM
$(vFile)
(qvd);
//If you don't need to include then try like this
Table:
CrossTable(Month, Data, 16)
LOAD
num(Date#($(vStart),'YYYYMMDD')) as StartDate,
null()as EndDate,
*
FROM
$(vFile)
(qvd);
thanks bro!
Solved! thanks for telling me the options!