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

Announcements
Register by January 31 for $300 off your Qlik Connect pass: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
jim_chan
Specialist
Specialist

Crosstable

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

1 Solution

Accepted Solutions
avinashelite

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);

View solution in original post

7 Replies
Not applicable

Hi Jim, Can you please share a sample?

jim_chan
Specialist
Specialist
Author

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);

Not applicable

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);

tresB
Champion III
Champion III

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);

avinashelite

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);

jim_chan
Specialist
Specialist
Author

thanks bro!

jim_chan
Specialist
Specialist
Author

Solved! thanks for telling me the options!