Column Types & Data Detection
Understand how DB Table automatically detects data types and learn about the six supported column types with examples and formatting options.
Column Types & Data Detection
One of DB Table's most powerful features is its ability to automatically detect and format different types of data. This guide explains how the detection system works and how to work with each supported data type.
Automatic Type Detection
How It Works
DB Table analyzes your data using a sophisticated detection algorithm:
- Sample Analysis - Examines the first 20 values in each column
- Pattern Recognition - Identifies common data patterns and formats
- Validation - Verifies detected types against the entire column
- Confidence Scoring - Assigns confidence levels to each detection
- Fallback Logic - Defaults to safer types when uncertain
Detection Priority
The system follows a specific order to avoid false positives:
- Boolean - Checked first (most specific)
- Numbers - Simple integers and decimals
- Currency - Numbers with currency symbols
- Percentage - Numbers with % symbols or 0-1 range
- Dates - Various date formats with validation
- String - Default fallback for everything else
Smart Detection: The system considers column names (like "price", "date", "percentage") to improve accuracy.
Supported Column Types
🔤 String (Text)
Purpose: General text data, names, descriptions, categories
Detection Criteria:
- Contains non-numeric characters
- Mixed alphanumeric content
- Default fallback type
Examples:
"John Smith"
"Product Description"
"Category A"
"Mixed123Content"
Formatting: Displayed as-is with no special formatting
🔢 Number
Purpose: Numeric data, quantities, measurements, IDs
Detection Criteria:
- Contains only digits and decimal points
- Matches pattern:
-?\d+(\.\d+)?
- No currency symbols or percentage signs
Examples:
42
-17.5
1234.56
0.001
Formatting:
- Decimal places preserved
- Negative numbers shown with minus sign
- Large numbers may include thousand separators
📅 Date
Purpose: Dates, timestamps, temporal data
Detection Criteria:
- Matches common date patterns
- Creates valid Date objects
- Year between 1900-2100 (reasonable range)
Supported Formats:
2024-01-15 (ISO format)
01/15/2024 (US format)
15/01/2024 (European format)
Jan 15, 2024 (Long format)
2024-01-15T10:30 (ISO with time)
Formatting:
- Standardized display format
- Timezone handling
- Invalid dates shown as "Invalid Date"
✅ Boolean (Yes/No)
Purpose: True/false values, yes/no questions, binary states
Detection Criteria:
- All values match boolean patterns
- Case-insensitive matching
Recognized Values:
true/false
yes/no
y/n
1/0
True/False
YES/NO
Formatting:
- Displayed as "Yes" or "No"
- Consistent capitalization
- Color-coded indicators
📊 Percentage
Purpose: Rates, ratios, percentages
Detection Criteria:
- Values end with % symbol
- Numeric values between 0-1 (converted to percentages)
- All values are numeric when % is removed
Examples:
25%
0.75 (displayed as 75%)
100%
-5.5%
Formatting:
- Always displays % symbol
- Decimal places preserved
- Values 0-1 automatically converted to percentages
💰 Currency
Purpose: Monetary values, prices, costs
Detection Criteria:
- Starts with currency symbols ($, €, £, ¥, etc.)
- Numeric content after symbol removal
- Consistent currency symbol across column
Supported Symbols:
$ (Dollar)
€ (Euro)
£ (Pound)
¥ (Yen)
₹ (Rupee)
₽ (Ruble)
₩ (Won)
R$ (Real)
Examples:
$25.99
€1,234.56
£99.00
¥500
Formatting:
- Currency symbol preserved
- Decimal places for cents/pence
- Thousand separators for large amounts
Manual Type Override
When to Override
Consider manual overrides when:
- Automatic detection is incorrect - Mixed data confuses the algorithm
- You need specific formatting - Force currency display for plain numbers
- Data context matters - ID numbers should stay as text to preserve leading zeros
- Consistency is important - Standardize similar columns across sheets
How to Change Column Types
- Locate the column you want to change
- Click the type indicator next to the column name
- Select new type from the dropdown menu
- Formatting updates immediately across all cells
- Reset option available to return to auto-detected type
Type Change Effects
From Type | To Type | Effect |
---|---|---|
String | Number | Attempts numeric conversion, invalid values become 0 |
Number | Currency | Adds default currency symbol ($) |
String | Date | Attempts date parsing, invalid dates show as "Invalid Date" |
Number | Percentage | Values > 1 treated as percentages, values ≤ 1 multiplied by 100 |
Any | String | Preserves display value as text |
Advanced Detection Features
Column Name Recognition
DB Table recognizes common column names and applies appropriate types:
Column Names | Auto-Applied Type |
---|---|
id, ID, Id | Number |
price, cost, amount | Currency |
date, created, modified | Date |
percentage, percent | Percentage |
Mixed Data Handling
When columns contain mixed data types:
- Majority rules - Most common type is selected
- Conservative approach - Defaults to String when uncertain
- Manual review - AI profiler can suggest better types
- Validation warnings - Highlights potential issues
Performance Optimization
For large datasets:
- Sample-based detection - Analyzes subset for speed
- Lazy validation - Full column validation on demand
- Caching - Remembers detection results
- Progressive enhancement - Improves accuracy over time
Best Practices
Preparing Data for Better Detection
- Consistent formatting - Use the same format throughout each column
- Clear headers - Use descriptive column names
- Clean data - Remove extra spaces and formatting
- Separate mixed types - Split columns with multiple data types
Optimizing Type Detection
- Review AI suggestions - Use the AI profiler for better accuracy
- Manual verification - Check auto-detected types for critical data
- Test with samples - Verify detection with representative data
- Document decisions - Note why you chose specific type overrides
Common Pitfalls
Leading zeros disappear
- Problem: ID numbers like "001" become "1"
- Solution: Keep as String type to preserve formatting
Dates not recognized
- Problem: Unusual date formats aren't detected
- Solution: Standardize format or use manual override
Currency without symbols
- Problem: Plain numbers that represent money
- Solution: Manually change to Currency type
Percentages as decimals
- Problem: 0.25 should be 25%
- Solution: Change to Percentage type (auto-converts)
Type Validation & Errors
Validation Rules
Each type has specific validation rules:
- Numbers: Must be valid numeric values
- Dates: Must create valid Date objects
- Booleans: Must match recognized boolean values
- Currency: Must be numeric after symbol removal
- Percentages: Must be numeric values
Error Handling
When validation fails:
- Error indicators show in affected cells
- Tooltip messages explain the issue
- Fallback display shows original value
- Edit mode allows correction
Next steps: Learn how to use the AI Data Profiler for even better type detection, or explore data editing to work with your properly typed data.