Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a dataset which is unit record level data, to count the number of units per group I created some variables. For example, if I want to count the units the last 7 days or 8-14 days I created an indicator such as 1 and 2, and this works fine. This table only have one single observation but the real table have multiples as-is unit record data.
What I need to do now is to create dynamic titles for these particular groups. For example, I need to get the min and max date for group 1, and group 2 and so on. Please see below a very small example in excel.
Date_var | Group |
1/01/2020 | 1 |
2/01/2020 | 1 |
3/01/2020 | 1 |
4/01/2020 | 1 |
5/01/2020 | 1 |
6/01/2020 | 1 |
7/01/2020 | 1 |
8/01/2020 | 2 |
9/01/2020 | 2 |
10/01/2020 | 2 |
11/01/2020 | 2 |
12/01/2020 | 2 |
13/01/2020 | 2 |
14/01/2020 | 2 |
15/01/2020 | 3 |
16/01/2020 | 3 |
17/01/2020 | 3 |
18/01/2020 | 3 |
19/01/2020 | 3 |
20/01/2020 | 3 |
21/01/2020 | 3 |
In this example, i want to display the min date for group 1, and I tried and it did not work
min(date( {$ [Group] ={1}>} ))
Thanks
Ian
Try like:
date(min( {<[Group] ={1}>} Date_var))
or, if your date values are strings:
date(min( {<[Group] ={1}>} Date#(Date_var, 'DD/MM/YYYY')))