Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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);

tresesco
MVP
MVP

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!