Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Add Column to Concatenated Table

Hello all,

I have 4 identical tables (split by years in the download) that are concatenated. They are basically Order Information with dates (order date, shipped date, invoiced date, etc).

What I want to do is, after loading and concatenating the 4 tables, do a couple of extra columns that calculate the time between dates as well as create a flag if the order shipped after it was supposed to.

I know that I can put these 5 or so calculations in each load statement but that doesn't seem to be the most efficienct. I tried doing something like:

Load *,

order date - shipped date as lag_time,

x - y  as z,

etc,

Resident Orders;

However, that doesn't seem to work well as it creates syn1 joins and an extra table. I thought about joining the resident table by using order numbers but that doesn't seem to work correctly as some orders have multiple lines.

Please point me in the right direction. Thanks!

Tags (2)
1 Solution

Accepted Solutions

Re: Add Column to Concatenated Table

After creating the new table drop the old one:

NewOrders:

Load *,

order date - shipped date as lag_time,

x - y  as z,

etc,

Resident Orders;

drop table Orders;


talk is cheap, supply exceeds demand
3 Replies

Re: Add Column to Concatenated Table

After creating the new table drop the old one:

NewOrders:

Load *,

order date - shipped date as lag_time,

x - y  as z,

etc,

Resident Orders;

drop table Orders;


talk is cheap, supply exceeds demand
Not applicable

Re: Add Column to Concatenated Table

try according to this syntax

load *, rowno() as key_table1;

load *, rowno() as key_table2;

load *, rowno() as key_table3;

load *, rowno() as key_table4;

then on the basis of this key you calculate the disired field.

Not applicable

Re: Add Column to Concatenated Table

Never had to do that before, but it works perfectly. Thank you sir!

Community Browser