
Re: Using sum and criteria
Ruben Marin Nov 17, 2016 10:20 AM (in response to Haidar Haj Ali)Hi Haj, you can use the E() function in set analysis, wich represent excluded values:
Sum({<[Type]={A}, UserField=E(UserField)>}TimeSpent)

Re: Using sum and criteria
Haidar Haj Ali Nov 17, 2016 10:39 AM (in response to Ruben Marin )Thanks Ruben, it help me go a step forward, but Sum({<[Type]={A}, DisplayName=E(DisplayName)>}TimeSpent , it gives the sum of spent time of all other users on sub task of type A. But it does not take into consideration to select only the parent tasks of which my user has spent time.
I am also trying to see how may I use P function.
Any other ideas?

Re: Using sum and criteria
Ruben Marin Nov 17, 2016 10:46 AM (in response to Haidar Haj Ali)Hi again, I didn't tested but maybe:
Sum({<[Type]={A}, DisplayName=E(DisplayName), TaskField=P(DisplayName)>}TimeSpent)
Edit: The P() function returns possible value, and maybe it should be:
Sum({<[Type]={A}, DisplayName=E(DisplayName), TaskField=P(TaskField)>}TimeSpent)

Re: Using sum and criteria
Haidar Haj Ali Nov 18, 2016 3:58 AM (in response to Ruben Marin )Hello again,
One more step forward
Sum({<[Type]={A}, DisplayName=E(DisplayName), key=P(key)>}TimeSpent it gives the sum of all time spent on sub task of type A for all tasks where the selected user worked on.
For example if the user worked only on a sub task type B in a task. I do not want that the sum include time passed on type A sub task of this parent task. But this expression take it into account.
I expand my previous example: in the data bellow i need to extract only the sum of green values.
Sum({<[Type]={A}, DisplayName=E(DisplayName), key=P(key)>}TimeSpent will give me the sum of green values +1 +4 (time spent parent task4, sub task 1 A).
Parent Task 1
SUB TASK 1 – type A
USER1, time spent 5
USER2, time spent 6
SUB TASK 1 – B
USER1, time spent 1
USER2, time spent 1
Parent Task 2
SUB TASK 1 – A
USER1,time spent 5
USER3,time spent 5
Sub TASK 2 – A
USER2, time spent 6
USER3, time spent 4
Parent Task 3
SUB TASK 1 – A
USER5,time spent 1
USER3,time spent 5
Sub TASK 2 – A
USER2, time spent 6
USER3, time spent 4
Parent Task 4
SUB TASK 1 – A
USER5,time spent 1
USER3,time spent 5
Sub TASK 2 – B
USER1, time spent 6
USER3, time spent 4

Re: Using sum and criteria
Ruben Marin Nov 18, 2016 4:08 AM (in response to Haidar Haj Ali)Hi HAJ, maybe with:
Sum({<[Type]={A}, DisplayName=E(DisplayName), key=P({<[Type]={A}>} key)>} TimeSpent)

Re: Using sum and criteria
Haidar Haj Ali Nov 18, 2016 4:10 AM (in response to Ruben Marin )Great, thanks a lot Rubin




