Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Resident Load Error

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

12 Replies
MVP & Luminary
MVP & Luminary

Re: Resident Load Error

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

Re: Resident Load Error

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

Not applicable

Re: Resident Load Error

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

Re: Resident Load Error

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];

Not applicable

Re: Resident Load Error

Yes I am doing that max value of Temp ID for every Orig Temp ID

Re: Resident Load Error

Did you try doing a right join?

Not applicable

Re: Resident Load Error

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;

Not applicable

Re: Resident Load Error

Hello Sunny

Any thoughts?

Thx

Riz

Re: Resident Load Error

Would you be able to share your exact script you are using or a sample?

Community Browser