Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Year_Week | Product |
2024-02 | 56 |
2024-01 | 26 |
2023-52 | 58 |
2023-51 | 79 |
2023-50 | 47 |
2023-49 | 44 |
I have a year week field as above; I created a variable equal to filed.
If I want to select 202402, it should give 202401, 202352, 202351 like past 3 weeks.
I tried this but it taking 202401, 202400, 202399
sum ({$ <YW={">=$(=max(YW)-3)"}>} product)
this it to get 2023-52, but its giving 202400
sum ({ <YW={'$(=max((V_YW)-2))'}>} product)
create a sort_order / serial numbers during data load
TEMP:
Load Year_Week,Product,RECNO() AS SR_NO inline [
Year_Week,Product
2024-02,56
2024-01,26
2023-52,58
2023-51,79
2023-50,47
2023-49,44
];
then use
SUM({<SR_NO={">=$(=Max(SR_NO)-2)<=$(=Max(SR_NO))"}>}Product)
create a sort_order / serial numbers during data load
TEMP:
Load Year_Week,Product,RECNO() AS SR_NO inline [
Year_Week,Product
2024-02,56
2024-01,26
2023-52,58
2023-51,79
2023-50,47
2023-49,44
];
then use
SUM({<SR_NO={">=$(=Max(SR_NO)-2)<=$(=Max(SR_NO))"}>}Product)
I have more data. every week its loading. And I changed from string to integer by removing "-". To make it easy
At current, its 202403 and last value is 202101.
202402,56
202401,26
202352,58
202351,79
202350,47
202349,44
..
..
202101,28