Friday, January 13, 2012 2:37 PM
On script tab 'FactSales - SCD Type2'
there is an Intervalmatch, which refers to field DateInvoiced:
// Temp
Temp_%KeyCustomer3:
Intervalmatch (DateInvoiced)
NoConcatenate Load
ValidFrom,
ValidTill
Resident Temp_%KeyCustomer2;
The resultset of this Intervalmatch contains 4 rows.
**
Searching backwards in the script the next occurence of
the field DateInvoiced is here :
Temp_%KeyCustomer1:
NoConcatenate Load
CustomerNumber as vCustomerNumber,
InvoiceNumber as vInvoiceNumber,
DateInvoiced
Resident FactSales_Source
Where RowId = $(i);
But: this only has a resultset of a single row !
**
Based on that this cannot be the source of the field
in used in the Intervalmatch.
To verify this I renamed the field:
Temp_%KeyCustomer1:
NoConcatenate Load
CustomerNumber as vCustomerNumber,
InvoiceNumber as vInvoiceNumber,
//DateInvoiced
DateInvoiced as DateInvoicedOM
Resident FactSales_Source
Where RowId = $(i);
Result does not change !
**
Searching further backwards in the script for
the field name leads to :
FactSales_Source:
LOAD
CustomerNumber,
InvoiceNumber,
DateInvoiced,
DateInvoiced as Invoiced.Date,
AmountInvoice
FROM $(vDataInput)\FactSales_Source.qvd (qvd);
This resultset contains 9 rows with 4 distinct DateInvoiced - values.
Question: why does Qlikview not refer to the next occurence of
the field backwards ?