Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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;
Are you using semi-colon ( ; ) after the table name?
Are you sure you are not dropping RawData after creating Tab1?
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.
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
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?
Yes we can use more than one resident table.... please share the qvw file.
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;
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.