Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
OK all - major rookie question here that I can not wrap my brain around. Inherited a lot of QVW data models that trying to unwind, make
sense of, update/upgrade.
1. Create a Table (TUnits). Got it.
2. Concatenate in data to TUnits from earlier period. Got it.
3. Concatenate in data to TUnits from an even earlier period. Got it, but getting fuzzy
4. The last LOAD...in the script has no designation for table. How does this last load get put into existing table????
OR - is this Qlikview being helpful by auto-concatenating because they're the same fields/structure?
One step forward...one step back and to the left for me on this Monday.
Thanks everyone for any input you can provide.
//CREATE TABLE TUnits
TUnits:
LOAD
PRODUCT_LINE,
BODY_TYPE,
PLBT,
BODY_LENGTH,
PRODUCTION_CODE,
MODEL_CODE,
LIFT_BUS_FLAG,
SED_FLAG,
date(ORDER_DATE) as ORDER_DATE,
DISTRIBUTOR_ID as UNIT_DISTRIBUTOR_ID,
STATE_ID,
UNIT_ID,
date(RFD_DATE) as RFD_DATE,
date(DELIVERY_DATE) as DELIVERY_DATE,
date(SCHEDULE_DATE) as SCHEDULE_DATE,
date(DATE_BOOKED) as DATE_BOOKED,
date(DATE_PROMISED) as DATE_PROMISED,
date(SETUP_DATE) as SETUP_DATE,
date(PRODUCTION_DATE) as PRODUCTION_DATE,
VIN,
CUSTOMER_NAME,
COMPONENT_ID,
CUSTOMER_COUNTY,
ENGINE_MODEL,
MODEL_YEAR,
BUS_TYPE,
UNIT_SEGMENT,
UNIT_FUEL_TYPE,
date(CHASSIS_SCHEDULE_DATE) as CHASSIS_SCHEDULE_DATE,
CHASSIS_SCHEDULE_SEQUENCE,
CHASSIS_ID,
date(DATE_CHASSIS_SETUP) as CHASSIS_SETUP_DATE
FROM
(qvd)
;
//CONCATENATE IN SOME ADDITIONAL DATA FROM PRIOR PERIOD
Concatenate(TUnits)
LOAD
PRODUCT_LINE,
BODY_TYPE,
PLBT,
BODY_LENGTH,
PRODUCTION_CODE,
MODEL_CODE,
LIFT_BUS_FLAG,
SED_FLAG,
date(ORDER_DATE) as ORDER_DATE,
DISTRIBUTOR_ID as UNIT_DISTRIBUTOR_ID,
STATE_ID,
UNIT_ID,
date(RFD_DATE) as RFD_DATE,
date(DELIVERY_DATE) as DELIVERY_DATE,
date(SCHEDULE_DATE) as SCHEDULE_DATE,
date(DATE_BOOKED) as DATE_BOOKED,
date(DATE_PROMISED) as DATE_PROMISED,
date(SETUP_DATE) as SETUP_DATE,
date(PRODUCTION_DATE) as PRODUCTION_DATE,
VIN,
CUSTOMER_NAME,
COMPONENT_ID,
CUSTOMER_COUNTY,
ENGINE_MODEL,
MODEL_YEAR,
BUS_TYPE,
UNIT_SEGMENT,
UNIT_FUEL_TYPE,
date(CHASSIS_SCHEDULE_DATE) as CHASSIS_SCHEDULE_DATE,
CHASSIS_SCHEDULE_SEQUENCE,
CHASSIS_ID,
date(DATE_CHASSIS_SETUP) as CHASSIS_SETUP_DATE
FROM
(qvd)
;
//CONCATENATE IN SOME ADDITIONAL DATA FROM EVEN EARLIER PRIOR PERIOD
Concatenate(TUnits)
LOAD
UnitNbr as UNIT_ID,
PLBT,
left(PLBT,2) as PRODUCT_LINE,
right(PLBT,2) as BODY_TYPE,
Lgth as BODY_LENGTH,
[Engine Mdl] as ENGINE_MODEL,
CustomerName as CUSTOMER_NAME,
date([ORD RCVD]) as ORDER_DATE,
date([ON ASSM]) as PRODUCTION_DATE,
date([DEL DATE]) as DELIVERY_DATE,
ST as STATE_ID,
Dealer as UNIT_DISTRIBUTOR_ID,
COUNTY as CUSTOMER_COUNTY,
VIN,
[YR-MDL] as MODEL_YEAR
FROM
(qvd)
;
// THIS DOES NOT MAKE SENSE TO ME. NO TABLE CREATE NAME HERE????
LOAD
PRODUCT_LINE,
BODY_TYPE,
PLBT,
BODY_LENGTH,
PRODUCTION_CODE,
MODEL_CODE,
LIFT_BUS_FLAG,
SED_FLAG,
date(ORDER_DATE) as ORDER_DATE,
DISTRIBUTOR_ID as UNIT_DISTRIBUTOR_ID,
STATE_ID,
UNIT_ID,
date(RFD_DATE) as RFD_DATE,
date(DELIVERY_DATE) as DELIVERY_DATE,
date(SCHEDULE_DATE) as SCHEDULE_DATE,
date(DATE_BOOKED) as DATE_BOOKED,
date(DATE_PROMISED) as DATE_PROMISED,
date(SETUP_DATE) as SETUP_DATE,
date(PRODUCTION_DATE) as PRODUCTION_DATE,
VIN,
CUSTOMER_NAME,
COMPONENT_ID,
CUSTOMER_COUNTY,
ENGINE_MODEL,
MODEL_YEAR,
BUS_TYPE,
UNIT_SEGMENT,
UNIT_FUEL_TYPE,
date(CHASSIS_SCHEDULE_DATE) as CHASSIS_SCHEDULE_DATE,
CHASSIS_SCHEDULE_SEQUENCE,
CHASSIS_ID,
date(DATE_CHASSIS_SETUP) as CHASSIS_SETUP_DATE
FROM
(qvd)
;
Hi,
You need to know one thing, Qlik concatenates the tables which has same number of columns with same name.
In such cases you dont need to define the concatenate keyword explicitly.
But when its not same and still you want to concatenate them, you use concatenate keyword to concatenate those tables.
And thats what is done in the script above.
Regards,
Kaushik Solanki
Hi,
You need to know one thing, Qlik concatenates the tables which has same number of columns with same name.
In such cases you dont need to define the concatenate keyword explicitly.
But when its not same and still you want to concatenate them, you use concatenate keyword to concatenate those tables.
And thats what is done in the script above.
Regards,
Kaushik Solanki
The last table seem to contain the historic data with the same fields created in the above script and this results in an automatic concatenation by qlik engine.
Infact, it is not mandatory to give any table names in the script.
Understood. Was thrown by the inconsistent syntax. Got it now!
Thanks sir. Makes sense.