Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi - I need to calculate the sum of three Departments' downtime based on metrics per Line. I need to calculate it as a weighted average as each Department has a different number of Lines.
Can anyone tell me what is wrong with my syntax?
=Sum({<Department = {('Dept1'/6), ('Dept2'/3), ('Dept3'/9)}>}Percentage))
Thank you!
Put them all in 1 line and put a + symbol between them.
Just a best guess of course, as I don't know your data model and also am not 100% sure about what you are aiming at.
You are trying to divide dimension values by 6, 3 and 9, not the sum of the measures related to those values.
Split that thing into 3 (sub-) expressions (one for each dept) and divide the result of each expression to the right weight. Add those together.
That's hard to tell without knowing something about your model, fields, data values.
What are ('Dept1'/6), ('Dept2'/3), ('Dept3'/9)? Field values in Department?
Maybe try something like
=Sum({<Department = {'Dept1','Dept2','Dept3'} >} Downtime)
/ Count({<Department = {'Dept1','Dept2','Dept3'} >} Downtime)
Could you show me please? I'm not getting the syntax right.
So this is basically what I need:
Sum({<Department = {'Dept1'}>}Percentage) /6
Sum({<Department = {'Dept2'}>}Percentage) /3
Sum({<Department = {'Dept3'}>}Percentage) /9
How do I add them together? Sorry - I'm learning!
"Department" = 'Dept1', 'Dept2', and 'Dept3'
"Percentage" is the metric I need to sum for all three departments.
Dept1 has 6 Lines, Dept2 has 3 Lines, and Dept3 has 9 Lines. I need to sum "Percentage" as a weighted average, because each department has a different number of Lines.
Put them all in 1 line and put a + symbol between them.
Just a best guess of course, as I don't know your data model and also am not 100% sure about what you are aiming at.
Thank you!
Happy I could help .