Code Mappings

Transform Excel values into LHDN-compliant codes and standardized formats using code mappings.

What are Code Mappings?

Code mappings allow you to transform values from your Excel file into the specific codes and formats required by LHDN. For example, you can convert "Service" to "01" for tax classification, or "Malaysia" to "MY" for country codes.

When to Use Code Mappings

Tax Codes

Convert descriptive tax types to LHDN tax codes:

  • "SST" → "01"
  • "Sales Tax" → "02"
  • "Service Tax" → "03"
  • "Exempt" → "E"

Country Codes

Standardize country names to ISO codes:

  • "Malaysia" → "MY"
  • "Singapore" → "SG"
  • "United States" → "US"

Currency Codes

Convert currency names to ISO codes:

  • "Ringgit" → "MYR"
  • "US Dollar" → "USD"
  • "Singapore Dollar" → "SGD"

Unit Codes

Transform unit descriptions to standard codes:

  • "pieces" → "C62"
  • "kilograms" → "KGM"
  • "hours" → "HUR"
  • "meters" → "MTR"

Setting Up Code Mappings

Accessing Code Mappings

  1. Go to your template's Configure page
  2. Click More Actions → Code Mappings
  3. Select the column you want to create mappings for

Creating Mappings

  1. Select Column: Choose which mapped column needs value transformation
  2. Add Mappings: Define Excel value → System value pairs
  3. Test: Verify mappings work with your actual data

Mapping Interface

For each code mapping, specify:

  • Excel Value: The value as it appears in your Excel file
  • System Value: The LHDN-compliant code to use
  • Description: Optional note explaining the mapping

Practical Examples

Tax Classification Mapping

Column: Tax Type

Excel Value    → System Value    Description
"Standard"     → "01"           Standard rated supply
"Zero"         → "02"           Zero rated supply
"Exempt"       → "03"           Exempt supply
"Out of Scope" → "04"           Out of scope

Product Category Mapping

Column: Product Category

Excel Value      → System Value    Description
"Goods"          → "01"           Physical goods
"Services"       → "02"           Service provision
"Digital"        → "03"           Digital services
"Consulting"     → "02"           Professional services

Customer Type Mapping

Column: Customer Type

Excel Value        → System Value    Description
"Individual"       → "B2C"          Business to Consumer
"Company"          → "B2B"          Business to Business
"Government"       → "B2G"          Business to Government

Advanced Code Mapping Strategies

Case-Sensitive Matching

Code mappings are case-sensitive by default:

  • "service" ≠ "Service" ≠ "SERVICE"
  • Create mappings for all variations you expect
  • Consider data cleaning before import

Partial Matching Strategies

For complex Excel values, you may need multiple mappings:

Excel Value                    → System Value
"Standard Rate (6%)"          → "01"
"Standard Rate 6%"            → "01"
"6% Standard"                 → "01"
"STD-6%"                      → "01"

Default Handling

When an Excel value doesn't match any mapping:

  • The original Excel value is used
  • May cause validation errors
  • Use comprehensive mappings to avoid issues

Best Practices

Complete Coverage

  • Map all expected values from your Excel files
  • Include common variations and typos
  • Test with historical data to find edge cases

Consistent Formatting

  • Use consistent system values across similar templates
  • Follow LHDN coding standards precisely
  • Document your mapping decisions

Maintenance Strategy

  • Review mappings periodically
  • Update when new Excel values appear
  • Keep descriptions current for team understanding

Managing Large Mapping Sets

Bulk Entry Strategy

For many mappings:

  1. Start with the most common values
  2. Import sample data to identify unmapped values
  3. Add mappings for failed values
  4. Repeat until coverage is complete

Organization Tips

  • Group related mappings logically
  • Use clear, descriptive names
  • Document business rules behind mappings

Validation and Testing

Testing Code Mappings

  1. Use the Validate Template action
  2. Test with a small sample file
  3. Review import results for mapping accuracy
  4. Check LHDN compliance of transformed values

Common Validation Issues

  • Missing Mappings: Excel values not found in mapping table
  • Invalid Codes: System values don't match LHDN standards
  • Format Errors: Incorrect code format for field type

Real-World Scenarios

Accounting System Export

When exporting from QuickBooks:

Excel Chart of Accounts → LHDN Tax Codes
"Sales:Standard Rate"   → "01"
"Sales:Zero Rate"       → "02"
"Sales:Exempt"          → "03"

E-commerce Platform

For online store exports:

Excel Product Type    → LHDN Classification
"Physical Product"    → "01"
"Digital Download"    → "02"
"Subscription"        → "02"
"Gift Card"          → "03"

Service Business

For professional services:

Excel Service Type     → LHDN Category
"Consultation"         → "01"
"Implementation"       → "01"
"Training"            → "02"
"Support"             → "02"

Troubleshooting Code Mappings

Mapping Not Applied

  • Verify exact spelling and case sensitivity
  • Check for extra spaces or hidden characters
  • Ensure the mapping is saved correctly

Validation Errors After Mapping

  • Confirm system values match LHDN requirements
  • Check field compatibility (e.g., tax codes for tax fields)
  • Verify date formats and number formats

Performance with Large Mapping Sets

  • Code mappings are processed efficiently
  • No practical limit on number of mappings
  • Complex mappings don't significantly impact import speed

Integration with Default Values

Code mappings work alongside default values:

  1. Code mappings transform existing Excel values
  2. Default values provide values for missing data
  3. Use both together for comprehensive data handling

Example Integration

1. Excel has "Std Rate" → Code mapping converts to "01"
2. Excel missing tax rate → Fixed default provides "0.06"
3. Excel missing currency → Conditional default provides "MYR" for Malaysian customers

Next Steps

After setting up code mappings:

  1. Configure default values for missing data
  2. Test your complete template with sample files
  3. Monitor import results for mapping accuracy