Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

saran7de
Contributor III

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

Re: Can we use more than one Resident Table?

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

7 Replies

Re: Can we use more than one Resident Table?

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

Capture.PNG

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

saran7de
Contributor III

Re: Can we use more than one Resident Table?

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
Contributor II

Re: Can we use more than one Resident Table?

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

Re: Can we use more than one Resident Table?

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

Re: Can we use more than one Resident Table?

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

Re: Can we use more than one Resident Table?

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

saran7de
Contributor III

Re: Can we use more than one Resident Table?

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.

Community Browser