top of page

TRF_TABLE Data Mapping

Requirement

Requirement: Develop an SQL-based logic to display all the columns as per the field mappings provided in the attached trf_invntry_txn_sql_mapping Excel file.

 

_The excel file mainly includes:_

 

  1. Data_map – This file contains the source-to-target mapping for the target fields
  2. Source_tables - this sheet contains the name of source tables, filter conditions and joining conditions between source tables.
  3. movment_mapping - Lookup file to populate the flag columns using the data in this sheet.
  4. lkp_mapping -Lookup to store the movement mapping and column details.

 

Acceptance Criteria:

 

  1. Use CTEs instead of temp views or subqueries in the main SQL.
  2. Any aggregation function should be handled in respective CTEs.
  3. Primary Keys to handle the duplicates are prod_plant_lot_location_key and transaction_id

 

Output: Display the Results

Purgo AI Agentic Code

bottom of page