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
- Select Your Model - Navigate to the model where you want to combine columns
- Add Combine Operation - Click "Combine Columns" in the operations panel
- Select Source Columns - Choose the columns to combine
- Choose Separator - Define how values should be joined (space, comma, etc.)
- Configure Options - Set NULL handling and formatting options
- Name New Column - Provide a meaningful name for the combined column
- Preview Results - View the combined data in the data grid
- 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
- Handle NULLs Gracefully - Decide how to handle missing values
- Choose Appropriate Separators - Use separators that make sense for your data
- Trim Whitespace - Clean data before combining
- Name Clearly - Use descriptive names for combined columns
- 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:
- Add a calculated column with conditional logic
- Combine based on conditions
- Handle special cases
Multi-Step Combination
For complex combinations:
- Combine subset of columns
- Clean/transform intermediate result
- Combine with additional columns
Format Standardization
Before combining:
- Standardize case (UPPER/LOWER)
- Trim whitespace
- 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
Related Operations
- Showing / Hiding Columns - Hide source columns after combining
- Sorting - Sort by combined column
- Adding Aggregations - Aggregate on combined identifiers
Related Formulas
For more complex combination scenarios:
- Joining Columns (CONCAT) - Formula-based combining
- Conditional Transforms (IF) - Conditional concatenation
- Handle NULL (COALESCE) - NULL handling in formulas
Detailed screenshots showing the column combining interface will be added soon.