With the help of Atlas AI tool I was abl to generate a formula that converts text to currency values. I am concerned that such a lengthy formula might slow down QuickSight if this formula is applied to 50+ columns in a single dashboard. Is there a better way of handling this?
// Atlas refactoring
// QuickSight Currency Formatter - Optimized v2026.01.29
// Converts text/numeric values to standardized currency format
ifelse(
// ═══════════════════════════════════════════════
// NULL & TEXT HANDLING
// ═══════════════════════════════════════════════
// Return null as-is
isNull({ats-gen 4.0-construction}), {ats-gen 4.0-construction},
// Filter text strings (contains vowels = status text like "Not Calculate", "Review")
contains(toLower({ats-gen 4.0-construction}), 'a') OR
contains(toLower({ats-gen 4.0-construction}), 'e') OR
contains(toLower({ats-gen 4.0-construction}), 'i') OR
contains(toLower({ats-gen 4.0-construction}), 'o') OR
contains(toLower({ats-gen 4.0-construction}), 'u'),
{ats-gen 4.0-construction},
// ═══════════════════════════════════════════════
// INTEGERS (No decimals)
// ═══════════════════════════════════════════════
// Simple integer: 1-999 → "$ 123.00"
locate({ats-gen 4.0-construction}, '-') = 0 AND
locate({ats-gen 4.0-construction}, ',') = 0 AND
locate({ats-gen 4.0-construction}, '.') = 0 AND
strlen({ats-gen 4.0-construction}) <= 3,
concat('$ ', {ats-gen 4.0-construction}, '.00'),
// Negative integer: -1 to -999 → "-$ 123.00"
locate({ats-gen 4.0-construction}, '-') = 1 AND
locate({ats-gen 4.0-construction}, ',') = 0 AND
locate({ats-gen 4.0-construction}, '.') = 0 AND
strlen({ats-gen 4.0-construction}) <= 4,
concat('-$', substring({ats-gen 4.0-construction}, 2, strlen({ats-gen 4.0-construction}) - 1), '.00'),
// Large integer: 1000+ → "$ 1,234.00"
locate({ats-gen 4.0-construction}, '-') = 0 AND
locate({ats-gen 4.0-construction}, '.') = 0 AND
locate({ats-gen 4.0-construction}, ',') = 0 AND
strlen({ats-gen 4.0-construction}) > 3,
concat('$ ',
substring({ats-gen 4.0-construction}, 1, strlen({ats-gen 4.0-construction}) - 3),
',',
substring({ats-gen 4.0-construction}, strlen({ats-gen 4.0-construction}) - 2, 3),
'.00'),
// Negative large integer: -1000+ → "-$ 1,234.00"
locate({ats-gen 4.0-construction}, '-') = 1 AND
locate({ats-gen 4.0-construction}, '.') = 0 AND
locate({ats-gen 4.0-construction}, ',') = 0 AND
strlen({ats-gen 4.0-construction}) > 4,
concat('-$',
substring({ats-gen 4.0-construction}, 2, strlen({ats-gen 4.0-construction}) - 4),
',',
substring({ats-gen 4.0-construction}, strlen({ats-gen 4.0-construction}) - 2, 3),
'.00'),
// Integer with commas: 1,234 → "$ 1,234.00"
locate({ats-gen 4.0-construction}, '-') = 0 AND
locate({ats-gen 4.0-construction}, ',') > 0 AND
locate({ats-gen 4.0-construction}, '.') = 0,
concat('$ ', {ats-gen 4.0-construction}, '.00'),
// Negative integer with commas: -1,234 → "-$ 1,234.00"
locate({ats-gen 4.0-construction}, '-') = 1 AND
locate({ats-gen 4.0-construction}, ',') > 0 AND
locate({ats-gen 4.0-construction}, '.') = 0,
concat('-$', substring({ats-gen 4.0-construction}, 2, strlen({ats-gen 4.0-construction}) - 1), '.00'),
// ═══════════════════════════════════════════════
// DECIMALS (Has period)
// ═══════════════════════════════════════════════
// Small decimal: 1.23 to 999.99 → "$ 123.45"
locate({ats-gen 4.0-construction}, '-') = 0 AND
locate({ats-gen 4.0-construction}, '.') > 0 AND
locate({ats-gen 4.0-construction}, ',') = 0 AND
strlen({ats-gen 4.0-construction}) <= 6,
concat('$ ',
split({ats-gen 4.0-construction}, '.', 1),
'.',
split({ats-gen 4.0-construction}, '.', 2),
ifelse(strlen(split({ats-gen 4.0-construction}, '.', 2)) = 1, '0', '')),
// Negative small decimal: -1.23 to -999.99 → "-$ 123.45"
locate({ats-gen 4.0-construction}, '-') = 1 AND
locate({ats-gen 4.0-construction}, '.') > 0 AND
locate({ats-gen 4.0-construction}, ',') = 0 AND
strlen({ats-gen 4.0-construction}) <= 7,
concat('-$',
substring(split({ats-gen 4.0-construction}, '.', 1), 2, strlen(split({ats-gen 4.0-construction}, '.', 1)) - 1),
'.',
split({ats-gen 4.0-construction}, '.', 2),
ifelse(strlen(split({ats-gen 4.0-construction}, '.', 2)) = 1, '0', '')),
// Large decimal: 1000.00+ → "$ 1,234.56"
locate({ats-gen 4.0-construction}, '-') = 0 AND
locate({ats-gen 4.0-construction}, ',') = 0 AND
locate({ats-gen 4.0-construction}, '.') > 0 AND
strlen({ats-gen 4.0-construction}) > 6,
concat('$ ',
substring(split({ats-gen 4.0-construction}, '.', 1), 1, strlen(split({ats-gen 4.0-construction}, '.', 1)) - 3),
',',
substring(split({ats-gen 4.0-construction}, '.', 1), strlen(split({ats-gen 4.0-construction}, '.', 1)) - 2, 3),
'.',
split({ats-gen 4.0-construction}, '.', 2),
ifelse(strlen(split({ats-gen 4.0-construction}, '.', 2)) = 1, '0', '')),
// Negative large decimal: -1000.00+ → "-$ 1,234.56"
locate({ats-gen 4.0-construction}, '-') = 1 AND
locate({ats-gen 4.0-construction}, ',') = 0 AND
locate({ats-gen 4.0-construction}, '.') > 0 AND
strlen({ats-gen 4.0-construction}) > 7,
concat('-$',
substring(split({ats-gen 4.0-construction}, '.', 1), 2, strlen(split({ats-gen 4.0-construction}, '.', 1)) - 4),
',',
substring(split({ats-gen 4.0-construction}, '.', 1), strlen(split({ats-gen 4.0-construction}, '.', 1)) - 2, 3),
'.',
split({ats-gen 4.0-construction}, '.', 2),
ifelse(strlen(split({ats-gen 4.0-construction}, '.', 2)) = 1, '0', '')),
// Decimal with commas: 1,234.56 → "$ 1,234.56"
locate({ats-gen 4.0-construction}, '-') = 0 AND
locate({ats-gen 4.0-construction}, '.') > 0 AND
locate({ats-gen 4.0-construction}, ',') > 0,
concat('$ ',
split({ats-gen 4.0-construction}, '.', 1),
'.',
split({ats-gen 4.0-construction}, '.', 2),
ifelse(strlen(split({ats-gen 4.0-construction}, '.', 2)) = 1, '0', '')),
// Negative decimal with commas: -1,234.56 → "-$ 1,234.56"
locate({ats-gen 4.0-construction}, '-') = 1 AND
locate({ats-gen 4.0-construction}, '.') > 0 AND
locate({ats-gen 4.0-construction}, ',') > 0,
concat('-$',
substring(split({ats-gen 4.0-construction}, '.', 1), 2, strlen(split({ats-gen 4.0-construction}, '.', 1)) - 1),
'.',
split({ats-gen 4.0-construction}, '.', 2),
ifelse(strlen(split({ats-gen 4.0-construction}, '.', 2)) = 1, '0', '')),
// Fallback for unmatched patterns
'N/A'
)

