Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have problem writing set-anlaysis in correct way and hope anyone can help me here.
Here is my dataset:
Person | date | Yes/no |
1 | 2017-01-01 | Yes |
1 | 2017-01-02 | No |
1 | 2017-01-03 | Yes |
1 | 2017-01-04 | No |
2 | 2017-01-01 | Yes |
2 | 2017-01-02 | No |
2 | 2017-01-03 | Yes |
2 | 2017-01-04 | No |
2 | 2017-01-05 | No |
2 | 2017-01-06 | Yes |
3 | 2017-01-01 | No |
3 | 2017-01-02 | Yes |
3 | 2017-01-03 | No |
3 | 2017-01-04 | Yes |
4 | 2017-01-05 | No |
4 | 2017-01-06 | No |
4 | 2017-01-07 | Yes |
4 | 2017-01-08 | No |
what I want to do is to get % how many persons hade yes on the latest date within the daterange 2017-01-01 to 2017-01-03
The answer here should be 67%
Hi Liivi,
try
Count(If(Aggr(FirstSortedValue({<date={'>=01-01-2017<=03-01-2017'}>} Yesno,-date),Person)='Yes',1))
/Count(Aggr(FirstSortedValue({<date={'>=01-01-2017<=03-01-2017'}>} Yesno,-date),Person))
Regards,
Antonio
Try like:
=Count({<[Yes/no]={Yes},Date={"$(=Date(Max({<Date={'>=01/01/2017<=03/01/2017'}>}Date)))"}>}[Yes/no])
/
Count({<Date={"$(=Date(Max({<Date={'>=01/01/2017<=03/01/2017'}>}Date)))"}>}[Yes/no])*100
The result is:
Date | Person | Yes/no | expr |
03/01/2017 | 1 | Yes | 1 |
2 | Yes | 1 | |
3 | No | 1 |
The result should be posts yellowmarked!
I thing there should be aggr function per person somewhere...
It should be the latest date per person within the daterange not the latest date ever....
Now all the persons had a det on 2017-01-03 but if there is a fitfth person:
Person | date | Yes/no |
1 | 2017-01-01 | Yes |
1 | 2017-01-02 | No |
1 | 2017-01-03 | Yes |
1 | 2017-01-04 | No |
2 | 2017-01-01 | Yes |
2 | 2017-01-02 | No |
2 | 2017-01-03 | Yes |
2 | 2017-01-04 | No |
2 | 2017-01-05 | No |
2 | 2017-01-06 | Yes |
3 | 2017-01-01 | No |
3 | 2017-01-02 | Yes |
3 | 2017-01-03 | No |
3 | 2017-01-04 | Yes |
4 | 2017-01-05 | No |
4 | 2017-01-06 | No |
4 | 2017-01-07 | Yes |
4 | 2017-01-08 | No |
5 | 2017-01-01 | No |
5 | 2017-01-02 | Yes |
Hi Liivi,
try
Count(If(Aggr(FirstSortedValue({<date={'>=01-01-2017<=03-01-2017'}>} Yesno,-date),Person)='Yes',1))
/Count(Aggr(FirstSortedValue({<date={'>=01-01-2017<=03-01-2017'}>} Yesno,-date),Person))
Regards,
Antonio
Thanx @Antonio Mancini It solved my problem!!!!