Skip to main content
Solved

Changing Data Types of a Metics and Removing the Current Value

  • January 29, 2025
  • 3 replies
  • 126 views

Forum|alt.badge.img+1

I have a metric that includes three dimensions—DimA, DimB, and DimC—along with a corresponding dollar amount for each intersection. I’d like to create a new metric where DimA and DimB remain as dimensions, but DimC becomes the result instead of a dimension for each of the intersections in the first metric. In doing this, I also want to drop the numeric data type and just have it as a dimension data type What would be the best way to achieve this in Pigment?

Best answer by Bryan Bauer

Thank you, ​@oliverlee! This is exactly what I needed and works great!

3 replies

oliverlee
Master Helper
Forum|alt.badge.img+12
  • Master Helper
  • January 30, 2025

Hi ​@Bryan Bauer,

I think the easiest way would be to use an IFDEFINED statement to return DimC element if your source metric has a value, and then remove your DimC dimension afterwards.

IFDEFINED(SourceMetric, DimC)[REMOVE FIRSTNONBLANK: DimC]


Forum|alt.badge.img+1
  • Author
  • Apprentice Helper
  • Answer
  • January 30, 2025

Thank you, ​@oliverlee! This is exactly what I needed and works great!


Forum|alt.badge.img+1
  • Author
  • Apprentice Helper
  • January 30, 2025

This has been resolved.