Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm new to Qlikview, but have spent sometime with an expert creating a set of documents. I'm not trying to modify what seems to be a simple set of Load statements, but keep getting a "Field not found" error. I've scanned around and can't find anything suggested which I haven't already done. If anyone can shed some light on this, I'd be delighted.
The field not being found is IM_PV. Code is below, along with the Error message:
SET vTable = 'VENDOR_CURRENT';
EXISTS_PILLAR_VENDORS:
LOAD
PillarVendor AS [IM_PV], Pillar AS [IM_Piller]
FROM
[..\..\4_StagingData\S1\AIO_T_AIO_I_IM?_Vendors.qvd]
(qvd);
$(vTable):
LOAD
// V_Fiscal,
Vendor_Text_Key AS [Vendor Current ID],
[IM_PV]
FROM
[..\..\4_StagingData\S1\AIO_T_AIO_I_Vendor_Current.qvd]
(qvd);
STORE $(vTable) INTO $(vStagingDataS2)\$(vOrg)_$(vTable).qvd (qvd);
Field not found - <IM_PV>
VENDOR_CURRENT:
LOAD
Vendor_Text_Key AS [Vendor Current ID],
[IM_PV]
FROM
[..\..\4_StagingData\S1\AIO_T_AIO_I_Vendor_Current.qvd]
(qvd)
Hi,
in the first example the field is loaded from the qvd, so it has to be present in it.
The Exists function checks the already loaded data model, so it's a different case.
hope this helps
regards
Marco
Use the File Wizard to create new load statement to load data from the qvd file 4_StagingData\S1\AIO_T_AIO_I_Vendor_Current.qvd. Then check if the field IM_PV actually exists in that qvd file. My guess is that it doesn't.
or you can use some tools (one is qviewer) to open the qvd file
[..\..\4_StagingData\S1\AIO_T_AIO_I_Vendor_Current.qvd]
and check the field
Firstly, thanks for the responses.
The field IM_PV doesn't exist in the qvd file, but I though the 1st LOAD statement (where the field IM_PV is created) was a pre-load, and that the 2nd LOAD statement would then pick the field up from the preload. Is that not correct?
It appears to work this way for the following statement, which does work. When this runs, I get back a new field IML_Vendor in the $(vTable) qvd which does not exist in the qvd file [..\..\4_StagingData\S1\AIO_T_AIO_I_Vendor_Current.qvd] :
EXISTS_IML_VENDOR:
LOAD
// LoadFiscal,
PillarVendor AS IML_Vendor,
1 AS [Vendor]
FROM
[..\..\4_StagingData\S1\AIO_T_AIO_I_IML_Vendors.qvd]
(qvd)
WHERE Pillar = 'IML';
$(vTable):
LOAD
Vendor_Text_Key AS [Vendor Current ID],
Exists(IML_Vendor, Vendor_Text_Key) * -1 AS [Vendor Current Is IML Vendor]
FROM
[..\..\4_StagingData\S1\AIO_T_AIO_I_Vendor_Current.qvd]
(qvd);
DROP Table EXISTS_IML_VENDOR;
Hi,
in the first example the field is loaded from the qvd, so it has to be present in it.
The Exists function checks the already loaded data model, so it's a different case.
hope this helps
regards
Marco
Hi Marco,
Many thanks for this. My thought process obviously hadn't caught onto what was going on with the Exists piece.
I'll work out how to achieve what I need now with this added knowledge of what's already going on
Thanks again,
Dave.