Qlik Community

Healthcare User Group

Announcements
QlikWorld online is next week! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rohitraturi
Contributor II
Contributor II

Unable to understand the following code

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.

1 Solution

Accepted Solutions
wandererroch
Contributor III
Contributor III

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?

View solution in original post

2 Replies
wandererroch
Contributor III
Contributor III

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?

rohitraturi
Contributor II
Contributor II
Author

Thanks. It helped.