1 2 Previous Next 28 Replies Latest reply on Feb 14, 2019 1:41 AM by Mihai Constantinescu Go to original post
• 15. Re: Datediff Calculation with Blending

not sure I understand what you want from above screenshot, do you want average of all durations for those Cases? I have created the LOD at Case level, and if you remove that from view it will just sum up the values... you will need another AVG on top

• 17. Re: Datediff Calculation with Blending

I want the average of all MIN First Response values, not the average of all First Response values for one case. See below example : After taking the MIN values for each case, divide them by the distinct count of Case Number to get the final result. (12.6 in this case)

• 18. Re: Datediff Calculation with Blending

there you go (with you case numbers as Context filters so that the LOD is reduced to your selection) 1 of 1 people found this helpful
• 19. Re: Datediff Calculation with Blending

Thanks a lot for your help Mihai. This seems to be working. However, I did not understand how this expression is working. Can you possibly give a brief description?

• 20. Re: Datediff Calculation with Blending

Have a look at LODs and examples as these are quite powerful. You can create your calculation at the level desired, in this case Case Number.

So we fixed our results (no matter what was being displayed in the view) to calculating for each Case Number the datediff between MIN first response and opened time. That part will give us per CN minimum duration. We then use another LOD as we want to average the previous results. {AVG ()} will compute average for entire data available, hence we want to use a context filter (limit the avg to the CNs that you want)

1 of 1 people found this helpful
• 21. Re: Datediff Calculation with Blending

Ah, I see. I've used LODs in the past but never in a nested way. This is powerful and interesting. Just to help me get a better understanding, can you tell me what would be the expression to solve the below problem :

I want to sum all the values in Value1 for each case and subtract the sum of all values in Value2 for the same case, and get a value for each case? • 22. Re: Datediff Calculation with Blending

{FIXED [Category] : SUM([Value1]) - SUM([Value2])} should do it

At Category level (C1, C2 etc) you compute sums of values (1 and 2) and then substract ...

1 of 1 people found this helpful
• 23. Re: Datediff Calculation with Blending

Awesome! Thanks for all your help Mihai. I have a much better understanding of LODs now.

• 24. Re: Datediff Calculation with Blending

Let's call the above calculation Test.

If I want to build a calculation that returns 1 if Test > 0 and 0 if Test < 0 for every Case Number, how do I achieve that?

• 25. Re: Datediff Calculation with Blending

Something like {FIXED [Case Number] : IF [Test] >0 then 1 else 0 end} ...

1 of 1 people found this helpful
• 26. Re: Datediff Calculation with Blending

If I add an INCLUDE before the AVG in the outer { }, will it change the expression to calculate the average response time per case but on the Viz LOD?

{ INCLUDE : AVG ({......}) }

• 27. Re: Datediff Calculation with Blending

{} is equivalent to {FIXED [Dimension] : AGG_Value}

If you change that to INCLUDE it should in theory adapt to your viz ... however, I suggest you play with it and see the results and also go again through some LOD documentation and check the differences (e.g. INCLUDE always produces a measure)

1 of 1 people found this helpful
1 2 Previous Next