Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm having trouble with the building-up of a keyfield between two tables:
I have to build in some formulas here because not all items in the tables can be linked using the same keyfield.
=> Of course i could do it all in one formula which would end up being a pretty long nested IF_construction
<=> I'd rather do this step-by-step so as to keep it understandable for others and for myself and easier manageable
=> I build my keyfield in a RESIDENT LOAD and for every new kind of items (every new variation on the keyfield_calculation I need) I
insert one more PRECEDING LOAD.
=> In the PRECEDING LOAD I build a new keyfield and name it keyfield_v2. So afterwards, I go
>> DROP FIELD keyfield FROM
Hi DataNibbler,
you made drop field from table which droped these field from this table but it is a key and exists within another table and therefore you couldn't rename it because the field exists - fields are in some way independent from the table in which they resides..
- Marcus
Oh, I think I know why ...
The fieldname > keyfield < of course exists in another table I have loaded prior to this one ... and the RENAME FIELD syntax does not let me specify which table I mean - or does it? It's not in the help_file, but then ...
Hi DataNibbler,
you made drop field from table which droped these field from this table but it is a key and exists within another table and therefore you couldn't rename it because the field exists - fields are in some way independent from the table in which they resides..
- Marcus
Hi Marcus,
that is an explanation. But is there also a possible solution? I always try to keep my code as legible, understandable and maintainable as possible - for myself and for others. And adding block by block onto a formula, so to speak, keeps it nice and simple. Is there a way to do that in this case?
Best regards,
DataNibbler
Hi DataNibbler,
it's difficult to say which way provides the best overview and maintainablility. Most probably I would keep the origin name for the key-field and change only the content from field but not the name and I believe that this even easier to follow as chain of dropping and renaming.
- Marcus
Wow!
I didn't know that was possible. Okay, now it works. Again what learned 😉
I had to abandon the * and load every field explicitly because otherwise a field > keyfield < already exists, but there are only five fields, so that was doable.
Thanks a lot!