Skip to main content

In Pigment, Is there any way to use a metric with BY modifier
I have two source metrics named as ‘Assigned’ and ‘Calendar Week’: 

  • “Assigned” with data type: Number
    Dimensions: Project, Role, Project Weeks
  • “Calendar Week” with data type: Weeks(dimension list) 
    Dimensions: Project, Project Weeks

I need to create a target metric:
“Final metric”: of the data type: Number
Dimensions: Project, Role, Weeks

I’m trying this formula for “Final Metric” : ‘Assigned’MBY: ‘Calendar Week’]
Since, Calendar Week is a metric and not a dimension list, formula is throwing error. Is there any way by which I can use the metric with modifiers?
Can someone let me know if there is any suitable approach for this solution?

Hi @pigment_enthusiast !

Your BY formula causes the dimension Project to be removed, as the normal behaviour of a BY is that it replaces the source dimensions by the new mapping dimension. 
What you could try is adding the → before the BY, this will ensure that the source dimensions are kept through the computation. Then afterwards you remove the dimension Project Weeks as you don't need that in your target with the REMOVE modifier. 
Your formula should be something like this: 

Assigned sby: ->'Calendar Week']rremove: 'Project Weeks']

For more information about the → please refer to this article

Hope this helps you further,


Hi @Stef ,
Got it, thanks! It worked.
The article for BY Mapping Parameter → Arrow is quite useful as it helps to aggregate the data from source metric to target metric through mapping metric.


Reply