I have a calc where I want to produce a continuous measure based on a case statement. I want the strings to format sufficient based on if I want '%' or not. The hours and FTE selections work correctly to populate separators, but the % of total selection results in nulls. I imagine because I'm wrapping an INT() around this calc so that I can create a continuous measure to model via a heatmap. Is there another way to do this?
INT(CASE [CIO Capacity Metrics Parameter]
WHEN '%' THEN
CASE [Incl. / Excl. OOO Parameter]
WHEN 0 THEN STR(ROUND(100*(SUM([HRS_HOURS])/TOTAL(SUM([HRS_HOURS]))),0)) + '%'
ELSE STR(ROUND(100*(SUM([Hours Total (Excl. OOO)])/TOTAL(SUM([Hours Total (Excl. OOO)]))),0)) + '%'
END
WHEN 'FTE' THEN
CASE [Incl. / Excl. OOO Parameter]
WHEN 0 THEN REGEXP_REPLACE(STR(ROUND(SUM([HRS_MONTH_FTE]),0)),"(\\d)(?=(\\d{3})+$)", "\\1," )
ELSE REGEXP_REPLACE(STR(ROUND(SUM([FTE Total (Excl. OOO)]),0)),"(\\d)(?=(\\d{3})+$)", "\\1," )
END
WHEN 'Hours' THEN
CASE [Incl. / Excl. OOO Parameter]
WHEN 0 THEN REGEXP_REPLACE(STR(ROUND(SUM([HRS_HOURS]),0)),"(\\d)(?=(\\d{3})+$)", "\\1," )
ELSE REGEXP_REPLACE(STR(ROUND(SUM([Hours Total (Excl. OOO)]),0)),"(\\d)(?=(\\d{3})+$)", "\\1," )
END
END)