Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Friends
Below is my piece of code
lTest:
Load *,
[Temp ID] as [New Temp ID]
from lTest.qvd(qvd);
MxTemp:
Load * ,max([New Temp ID] as [New Temp ID]) ,[Orig Temp ID]
Resident lTest group by [Orig Temp ID];
The error I am getting says field names must be unique within Tale. This error pops up when about to load Temp. But If I want all my columns isnt Load * from resident the right way? Because I will be dropping the lTest Table and later will be fropping the MxTemp Table when I use it as a resident for another table.
Thoughts?
Thanks
Rizwan
You load the resident-load with a wildcard which meant that you included the field [New Temp ID] from the table lTest and within these load you call the max([New Temp ID]) also [New Temp ID] and there it is doubled. But this isn't the only issue then your group by won't include all fields from the wildcard. Therefore try something like this:
lTest:
Load * from lTest.qvd(qvd);
join(lTest)
Load [Temp ID] ,max([Temp ID] as [Max Temp ID])
Resident lTest group by [Temp ID];
- Marcus
What exactly are you trying to do. Not just unique field name, but also the group by statement will be an issue in what you are doing here. If you can elaborate on what you are trying to do, may be we might be able to help you out here
Hello Marcus
After inserting your script
Now I am trying to call this into an another table something like this
Total:
LOAD * Resident lTest where exists ([Max Temp ID]) and exists ([Orig Temp ID);
Drop Table lTest
Somehow its not reading the whereexists part
Thoughts?
Thanks
Are you only looking to pull the Max value of Temp ID for each Orig Temp ID? May be this
lTest:
Load * from lTest.qvd(qvd);
Right Join (lTest)
Load [Temp ID] ,max([Temp ID] as [Max Temp ID])
Resident lTest group by [Temp ID];
Yes I am doing that max value of Temp ID for every Orig Temp ID
Did you try doing a right join?
Hello Marcus
Yes it does not give me expected result.
I got it to work in another way but that is not an efficient way. so trying to do it via resident load.
Currently my code is like this:
I need to get the last part of it (exists ) to work.
lTest:
Load * from lTest.qvd(qvd);
Right Join(lTest)
Load [Orig Temp ID],max([Temp ID]) as [Max Temp ID]
Resident lTest Group By [Orig Temp ID]
;
Temp:
LOAD * Resident lTest where exists ([Max Temp ID]) and exists ([Orig Temp ID]);
drop table lTest;
Store Temp into Temp.qvd;
Hello Sunny
Any thoughts?
Thx
Riz
Would you be able to share your exact script you are using or a sample?