Skip to main content

Combining Columns

Combining multiple columns into one is a common transformation for creating full names, addresses, identifiers, and more. Visitran's No-Code UI makes this easy without writing formulas.

Overview

Column combination merges values from two or more columns into a single column using visual tools. This is useful for creating composite fields, generating labels, and preparing data for presentation.

When to Combine Columns

Creating Composite Fields

  • Full names from first and last names
  • Full addresses from street, city, state, zip
  • Complete identifiers from multiple parts

Data Presentation

  • User-friendly display values
  • Formatted output for reports
  • Combined labels and descriptions

Data Standardization

  • Consistent formatting across sources
  • Unified identifiers
  • Merged duplicate information

How to Combine Columns in Visitran

Step-by-Step Instructions

  1. Select Your Model - Navigate to the model where you want to combine columns
  2. Add Combine Operation - Click "Combine Columns" in the operations panel
  3. Select Source Columns - Choose the columns to combine
  4. Choose Separator - Define how values should be joined (space, comma, etc.)
  5. Configure Options - Set NULL handling and formatting options
  6. Name New Column - Provide a meaningful name for the combined column
  7. Preview Results - View the combined data in the data grid
  8. Save - Apply the changes to your model

Combination Options

Separator - Character(s) between combined values:

  • Space: " "
  • Comma: ", "
  • Dash: "-"
  • Custom: Any text

NULL Handling - How to handle NULL values:

  • Skip NULLs: Omit NULL values from result
  • Include NULLs: Show as empty strings
  • Replace NULLs: Use default value

Trim Whitespace - Remove leading/trailing spaces before combining

Common Use Cases

Full Names

Combine:
- first_name
- last_name
Separator: " " (space)
Result: "John Smith"

Full Address

Combine:
- street_address
- city
- state
- zip_code
Separator: ", "
Result: "123 Main St, Springfield, IL, 62701"

Product Identifiers

Combine:
- category_code
- product_code
- variant_code
Separator: "-"
Result: "ELEC-LAP-001"

Date and Time Display

Combine:
- date_part
- time_part
Separator: " at "
Result: "2024-01-15 at 14:30"

Combination Patterns

Name Formatting

Format: last_name + ", " + first_name + " " + middle_initial
Example: "Smith, John M"

Email Display Names

Format: first_name + " " + last_name + " <" + email + ">"
Example: "John Smith <john.smith@example.com>"

Hierarchical Identifiers

Format: region + "-" + store + "-" + register
Example: "WEST-SF01-REG3"

Title with Context

Format: title + " (" + year + ")"
Example: "Annual Report (2023)"

Best Practices

  1. Handle NULLs Gracefully - Decide how to handle missing values
  2. Choose Appropriate Separators - Use separators that make sense for your data
  3. Trim Whitespace - Clean data before combining
  4. Name Clearly - Use descriptive names for combined columns
  5. Consider Downstream - Think about how the combined data will be used

NULL Value Handling Strategies

Skip NULLs

first_name: "John"
middle_name: NULL
last_name: "Smith"

Result: "John Smith" (skips NULL middle_name)

Include Empty Strings

first_name: "John"
middle_name: NULL
last_name: "Smith"

Result: "John Smith" (extra space where NULL was)

Replace with Default

first_name: "John"
middle_name: NULL → "(no middle name)"
last_name: "Smith"

Result: "John (no middle name) Smith"

Performance Considerations

  • Combine Early - Combine columns early if result is used in filters or joins
  • Index Appropriately - Consider indexing combined columns if used in queries
  • Limit Length - Be aware of maximum column lengths
  • Avoid Large Text - Combining large text fields can impact performance

Advanced Techniques

Conditional Combining

Use the No-Code UI to:

  1. Add a calculated column with conditional logic
  2. Combine based on conditions
  3. Handle special cases

Multi-Step Combination

For complex combinations:

  1. Combine subset of columns
  2. Clean/transform intermediate result
  3. Combine with additional columns

Format Standardization

Before combining:

  1. Standardize case (UPPER/LOWER)
  2. Trim whitespace
  3. Replace special characters

Visual Tools vs. Formulas

Use No-Code UI When:

  • Simple concatenation with separators
  • Consistent formatting
  • Quick prototyping

Use Formula Columns When:

  • Complex conditional logic needed
  • Custom formatting requirements
  • Advanced NULL handling

See Joining Columns with Formulas for formula-based approaches.

Troubleshooting

Unexpected Spaces

  • Enable "Trim Whitespace" option
  • Check source data for extra spaces
  • Review separator configuration

NULL Values Showing

  • Configure NULL handling option
  • Consider replacing NULLs before combining
  • Use COALESCE in formula approach

Performance Issues

  • Limit number of columns combined
  • Check for very long text fields
  • Consider combining in stages

Wrong Order

  • Verify column order in combination
  • Check source column names
  • Review preview before saving

For more complex combination scenarios:


Detailed screenshots showing the column combining interface will be added soon.