Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good Afternoon Qlikview community,
Hopefully this is an easy one to solve. I have a table with several fields in and two of them hold simular data. I would like to merge these two fields together so they are one.
Here are some of the fields
Town
City
Departure
Arrival
Company Departure
Company Arrival
I would like Company Departure and Company Arrival as Company. so I thought it would be something like
TravelPlan:
LOAD
Town,
City,
Departure,
Arrival,
Company Departure AS Company,
Company Arrival AS Company
FROM...
But that did not work.
Any help would be highly appreciated.
Thanks again
Mark
If in a record only one of the two fields has a value you can concatenate them:
[Company Departure] & [Company Arrival] AS Company.
Otherwise you'll have to load the departures and arrivals separately in two loads:
Table:
LOAD Town, City, Departure, Arrival,
[Company Departure] AS Company
from ...somewhere...
where len(trim([Company Departure]))>0;
LOAD Town, City, Departure, Arrival,
[Company Arrival] AS Company
from ...somewhere...
where len(trim([Company Arrival]))>0;
If in a record only one of the two fields has a value you can concatenate them:
[Company Departure] & [Company Arrival] AS Company.
Otherwise you'll have to load the departures and arrivals separately in two loads:
Table:
LOAD Town, City, Departure, Arrival,
[Company Departure] AS Company
from ...somewhere...
where len(trim([Company Departure]))>0;
LOAD Town, City, Departure, Arrival,
[Company Arrival] AS Company
from ...somewhere...
where len(trim([Company Arrival]))>0;
Hi,
You should not give same name for two fields in a table, it throws an error.
TravelPlan:
LOAD
Town,
City,
Departure,
Arrival,
Company Departure AS Company,
Company Arrival AS Company
FROM...
So, you can give two different names for this two columns. If Company Departure and
Company Arrival holds same data then there is no need of loading two columns, you can just load a single column.
Regards,
Jagan.
Thank you Gysbert, That did the trick
Hi,
I loaded two tables. inbetween 2 tables i have written "add". Now i got combination of 2 fields data.
Is it right way?
Can you create a new thread and attach sample data/script and your expected result.
Regards,
Jagan.