Issue with template expression

Hi I was wondering if someone could help me verify this template expression? I canโ€™t get it to return anything. The exact same expression return values in the editor. I canโ€™t figure out what I am missing

<<Start: [Related Job Activities]>>
<<TOTALHOURS(SUM(SELECT(Job Activity[Duration],[Production Id]=[_THISROW].[Production Id])))>>
<<End>>
Solved Solved
0 3 288
1 ACCEPTED SOLUTION

Can you try this:

TOTALHOURS(SUM([Related Job Activities][Duration]))

View solution in original post

3 REPLIES 3

Can you try this:

TOTALHOURS(SUM([Related Job Activities][Duration]))

That did the trick. thank-you.

However, what if I want to take the same expression and drill down? For example,

<<Start: [Related Job Activities]>>
<<TOTALHOURS(SUM(SELECT(Job Activities[DURATION],AND([Production Id]=[_THISROW].[Production Id],[Production Assignment]=[_THISROW]."Packaging")))) >>
<<End>>

I would have to use a SELECT expression, correct?

Lastly, can you explain why my original formula didnโ€™t work so I know the limitations of template expressions?

I donโ€™t know why your original formula did not work.

As to how to drill down, if there are not too many cases, I would create slices of the Job Activities table and add another VC similar to [Related Job Activities] which is probably a REF_ROWS(โ€œJob Activitiesโ€,โ€œKeyColโ€) formula referencing that slice - i.e., REF_ROWS(โ€œJob Activities Sliceโ€,โ€œKeyColโ€)

Top Labels in this Space