I’m working to duplicate a calculation that’s currently being done in Tableau, using Tableau’s “fixed calculation” feature.

Previously I posted in the forum and with help was able to replicate the “fixed calculation” using Dundas’ function properites. An example is " SUM($unitWeight$,$calendarDate$,$userName$) " , which sums $unitWeight$ while holding $calendarDate$ and $userName$ fixed.

Now I want to do a similar calculation to replicate the Tableau calculation below:

The issue I’m having is that I don’t know how to tell Dundas to only sum (for example) $AgentStateTimeInSecs$ when $AgentState$ is “loginTimeInSecs”.

Dundas won’t allow me to bring dimensions into functions, and $AgentState$ is a dimension.

Is this a problem that can only be solved by modifying the data cube? Or can it be done in a metric set?

Thanks for the help, I’m finding the forum very useful!