SOLVED
Alteryx IN DB Latest 3 years score >=7
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
winniechoy
6 - Meteoroid
‎07-23-2023
09:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Labels:
3 REPLIES 3
simonaubert_bd
13 - Pulsar
‎07-23-2023
09:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @winniechoy
Not sure to understand the wanted output. Could you please clarify?
Best regards,
Simon
‎07-23-2023
09:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
outcome should be, as latest 3 years are both >=7
ID | Indicator latest 3 years >=7 |
1 | Yes |
simonaubert_bd
13 - Pulsar
‎07-23-2023
10:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
![](/skins/images/D34B41DA407DC996E7BFF253AD24F7E2/responsive_peak/images/icon_anonymous_message.png)