Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help on synthetic keys!

Hi,

I need the output of the table in the file as it is, but I am not able to get rid of the synthetic key in the script.

The problem is that I need the table to show 0 hours even when there is no record.

I solved it but I don´t like the solution.

Any suggestions??

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

You can also create a composite key consisting of the fields Quincena, Horas and IDlink.


HORAS0:
Load
Quincena&'|'&Empleado&'|'&Horas AS CompKey,
NQuincena,
Quincena,
Horas,
HorasMAX,
Empleado as IDlink
resident HORAS0temp;
Drop table HORAS0temp;

planning:
LOAD * INLINE [
CompKey
JUN08Q1|0001|2
JUN08Q2|0001|8
JUN08Q2|0001|25
JUN08Q1|0002|1
];


You can still add the fields as separate fields to the inline table of course. But change the names so they are not the same in both tables.

View solution in original post

6 Replies
Not applicable
Author

Anyone..?

Not applicable
Author

Hi,

Try that one ;


planning:
qualify "Quincena","Horas";
LOAD * INLINE [
Quincena, IDlink, Horas,
JUN08Q1, 0001, 2
JUN08Q2, 0001, 8
JUN08Q2, 0001, 25
JUN08Q1, 0002, 1
];


Im not surely understand what is the main purpose of your report but if the main problem was synthetic key you should use qualify or alias to get rid off systentic key.

Best Regards,

Önder ALTINBILEK

Not applicable
Author

You can also create a composite key consisting of the fields Quincena, Horas and IDlink.


HORAS0:
Load
Quincena&'|'&Empleado&'|'&Horas AS CompKey,
NQuincena,
Quincena,
Horas,
HorasMAX,
Empleado as IDlink
resident HORAS0temp;
Drop table HORAS0temp;

planning:
LOAD * INLINE [
CompKey
JUN08Q1|0001|2
JUN08Q2|0001|8
JUN08Q2|0001|25
JUN08Q1|0002|1
];


You can still add the fields as separate fields to the inline table of course. But change the names so they are not the same in both tables.

Not applicable
Author

Thanks all for your help. I fugured out how to solve the issue thanks to your answers.

Not applicable
Author

Hi Sjoerd,

Can you please share how you resolved this issue. I am also facing synthetic key problem. Let me know how to resolved the same.

pgalvezt
Specialist
Specialist

Hi Sjoerd,

Can you please share how you resolved this issue. I am also facing synthetic key problem. Let me know how to resolved the same.