Hi I'm trying to create an input file for Qlik dashboard for Inventory Value- Daily/ Weekly/ Monthly. So I'm recording Daily values and trying to create Week Flag and Month Flag. Week flag- 1 : For past weeks, dates of End of week value, For current week, Latest Date (or today's date) & 0 for the rest. similarly for Month Flag.
Desired output looks like below: (Date values are the input). Please help.
| Date | Week | WeekFlag | MonthFlag |
| 3/28/2023 | 13 | 0 | 0 |
| 3/29/2023 | 13 | 0 | 0 |
| 3/30/2023 | 13 | 0 | 0 |
| 3/31/2023 | 13 | 0 | 1 |
| 4/1/2023 | 13 | 1 | 0 |
| 4/2/2023 | 14 | 0 | 0 |
| 4/3/2023 | 14 | 0 | 0 |
| 4/4/2023 | 14 | 0 | 0 |
| 4/5/2023 | 14 | 0 | 0 |
| 4/6/2023 | 14 | 0 | 0 |
| 4/7/2023 | 14 | 0 | 0 |
| 4/8/2023 | 14 | 1 | 0 |
| 4/9/2023 | 15 | 0 | 0 |
| 4/10/2023 | 15 | 0 | 0 |
| 4/11/2023 | 15 | 0 | 0 |
| 4/12/2023 | 15 | 0 | 0 |
| 4/13/2023 | 15 | 0 | 0 |
| 4/14/2023 | 15 | 1 | 0 |
| 4/20/2023 | 16 | 1 | 1 |
