Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the following in the script and need to create a key
fldPeronID & PayrollCode as key1
in TABLEA
TABLEA:
LOAD
fldPersonID,
TravelTime,
Service
From
[lib://QVD/Time.qvd]
(qvd)
LEFT JOIN
fldPersonID,
PayrollCode
From
[lib://QVD/Payroll.qvd]
(qvd);
Any ideas on how/where I can create the key in TABLEA?
Thanks
Hi
you can using Autonumber function to create a number Key, or concatenate two column fldPeronID & PayrollCode as key after load TABLEA with Join
TABLEA_WITH_NEW_KEY:
Load
Autonumber (fldPeronID & PayrollCode ) as Key, // or fldPeronID & PayrollCode as key
*
resident TABLEA ;
Drop table TABLEA ;
Regards
Hi
you can using Autonumber function to create a number Key, or concatenate two column fldPeronID & PayrollCode as key after load TABLEA with Join
TABLEA_WITH_NEW_KEY:
Load
Autonumber (fldPeronID & PayrollCode ) as Key, // or fldPeronID & PayrollCode as key
*
resident TABLEA ;
Drop table TABLEA ;
Regards
Hi, I think you need to create a new table and drop TABLEA
NewTableA:
NoConcatenate
Load *,
fldPeronID & PayrollCode as key1
Resident TABLEA;
Drop Table TABLEA;
I'd suggest :
NewTableA:
NoConcatenate
Load *,
autonumber( fldPeronID & '|' & PayrollCode )as key1
Resident TABLEA;
Drop Table TABLEA;
the reason to seperate between the 2 fields by a | for example; is to make sur the key is unique.
example to illustrate my point :
fldPeronID=100
PayrollCode =10
fldPeronID & PayrollCode =10010
but
fldPeronID=10
PayrollCode =010
fldPeronID & PayrollCode =10010
with that, we create the same for 2 differents set of values !
but if we seperate them by sthing '|', we make sure to have a unique key for each combination.
then we surround the new key by autonumber to make it as a num
Thanks!