Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Saravanan_Desingh

Can we use more than one Resident Table?

I just started learning QV. I have a situation. My Table looks like this.

RawData:

Load r1, r2, r3 from data.xls;

Tab1;

Load r2 as t21, r3 as t31 Resident RawData where r1='A';

Tab2;

Load r2 as t22, r3 as t32 Resident RawData where r1='B';

While I try the above, I am getting Field not found Error for Tab2.

If the above steps are not possible, can you help me with any other smart approach? Thanks.

1 Solution

Accepted Solutions
sunny_talwar

This is working for me:

RawData:

LOAD r1,

    r2,

    r3

FROM

Data123.xlsx

(ooxml, embedded labels, table is Sheet1);

Tab1:

Load r2 as t21, r3 as t31 Resident RawData where r1='A';

Tab2:

Load r2 as t22, r3 as t32 Resident RawData where r1='B';

Tab3:

Load r2 as t23, r3 as t33 Resident RawData where r1='C';

DROP Table RawData;


Capture.PNG

View solution in original post

7 Replies
sunny_talwar

Are you using semi-colon ( ; ) after the table name?

Capture.PNG

Are you sure you are not dropping RawData after creating Tab1?

Saravanan_Desingh
Author

I am sorry. Its typo. I was converting my live data to understandable format. Please see my script.

RawData:

Load r1, r2, r3 from data.xls;

Tab1:

Load r2 as t21, r3 as t31 Resident RawData where r1='A';

Tab2:

Load r2 as t22, r3 as t32 Resident RawData where r1='B';

Tab3:

Load r2 as t23, r3 as t33 Resident RawData where r1='C';

Drop Table RawData;

I want to split the table into 3, with different field names based on a condition.

gsbeaton
Luminary Alumni
Luminary Alumni

I suspect the problem is your semi colon after the table names, it should be

Tab1:

Load r2 as t21, r3 as t31 Resident RawData where r1='A';

Tab2:

Load r2 as t22, r3 as t32 Resident RawData where r1='B';

Other than that, your syntax is correct and this is perfectly legitimate in QlikView.

Hope that helps

George

sunny_talwar

Can you share a sample of where it isn't working? I don't see any reason why the above script should have a problem running?

Not applicable

Yes we can use more than one resident table.... please share the qvw file.

sunny_talwar

This is working for me:

RawData:

LOAD r1,

    r2,

    r3

FROM

Data123.xlsx

(ooxml, embedded labels, table is Sheet1);

Tab1:

Load r2 as t21, r3 as t31 Resident RawData where r1='A';

Tab2:

Load r2 as t22, r3 as t32 Resident RawData where r1='B';

Tab3:

Load r2 as t23, r3 as t33 Resident RawData where r1='C';

DROP Table RawData;


Capture.PNG

Saravanan_Desingh
Author

Thank you all for your timely response.

My issue was sorted out. I did a mistake in my where Clause.

Resident RawData

  Where [Aligned Sector] Like 'Voice%'

  ;

It should have been

Resident RawData

  Where [Aligned Sector] Like 'Voice*'

  ;

Anyway this thread clears few of my doubts.