Hi All,
I would like to ask how to create a indicator by using IN DB Formula,
define latest 3 years score >=7?
Any other suggestion with INDB tools are welcomed.
Many Thanks.
ID | Year | Score |
1 | 2020 | 5 |
1 | 2021 | 6 |
1 | 2022 | 7 |
1 | 2023 | 8 |
1 | 2024 | 9 |
Solved! Go to Solution.
Hello @winniechoy
Not sure to understand the wanted output. Could you please clarify?
Best regards,
Simon
outcome should be, as latest 3 years are both >=7
ID | Indicator latest 3 years >=7 |
1 | Yes |
Something like that in SQL?
SELECT MIN(Score)<=7 AS Min_Score_Last_3_Years FROM your_table_name WHERE Year >= YEAR(CURDATE()) - 2;
you would need first a filter in db to specify Year >= YEAR(CURDATE()) - 2
and then a summarize in db to aggregate your score to min
and finally a formula in-db for MIN(Score)<=7