Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Corrected_Fact:
NOCONCATENATE
LOAD *
RESIDENT [Master Fact]
WHERE match(Corrected, 'Y');
DROP FIELDS [Posting Date] FROM Corrected_Fact;
LEFT JOIN(Corrected_Fact)
LOAD DISTINCT
[Corrected Date]
, [Corrected Date] AS [Posting Date]
RESIDENT Corrected_Fact;
DROP Fields [Corrected Date];
DROP Fields Corrected FROM [Master Fact];
// Unable to understand from here
LEFT JOIN ([Master Fact])
LOAD 'N' AS Corrected
Autogenerate 1;
CONCATENATE([Master Fact])
LOAD *
RESIDENT Corrected_Fact;
DROP TABLES Corrected_Fact;
I have this code in one of the apps. I am unable to understand the code entirely. It will be a great help if someone can explain to me what exactly the code is doing.
Thanks in advance.
The script looks like an attempt to replace a posting date for rows where a correction is indicated and then remove the indicator.
I think the code does the following:
Makes a copy of the master fact where a correction is indicated.
in the copy replaces the posting date with the 'corrected' posting date.
writes 'N' to the Corrected field in the master fact table for everything and then writes the proper values of posting date into the master fact from the copy. the 'N' in all rows indicates there are no un-applied corrections.
Does that make sense?
The script looks like an attempt to replace a posting date for rows where a correction is indicated and then remove the indicator.
I think the code does the following:
Makes a copy of the master fact where a correction is indicated.
in the copy replaces the posting date with the 'corrected' posting date.
writes 'N' to the Corrected field in the master fact table for everything and then writes the proper values of posting date into the master fact from the copy. the 'N' in all rows indicates there are no un-applied corrections.
Does that make sense?
Thanks. It helped.