Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have below input table and a filter to select Year and Week.
My requirement is to see the trend in line chart for last 14 weeks from the week I select.
Year | Week No | Sales |
2018 | 1 | 100 |
2018 | 2 | 101 |
2018 | 3 | 102 |
2018 | 4 | 103 |
2018 | 5 | 104 |
2018 | 6 | 105 |
2018 | 7 | 106 |
2018 | 8 | 107 |
2018 | 9 | 108 |
2018 | 10 | 109 |
2018 | 11 | 110 |
2018 | 12 | 111 |
2018 | 13 | 112 |
2018 | 14 | 113 |
2018 | 15 | 114 |
2018 | 16 | 115 |
2018 | 17 | 116 |
2018 | 18 | 117 |
2018 | 19 | 118 |
2018 | 20 | 119 |
2018 | 21 | 120 |
2018 | 22 | 121 |
2018 | 23 | 122 |
2018 | 24 | 123 |
2018 | 25 | 124 |
2018 | 26 | 125 |
2018 | 27 | 126 |
2018 | 28 | 127 |
2018 | 29 | 128 |
2018 | 30 | 129 |
2018 | 31 | 130 |
2018 | 32 | 131 |
2018 | 33 | 132 |
2018 | 34 | 133 |
2018 | 35 | 134 |
2018 | 36 | 135 |
2018 | 37 | 136 |
2018 | 38 | 137 |
2018 | 39 | 138 |
2018 | 40 | 139 |
2018 | 41 | 140 |
2018 | 42 | 141 |
2018 | 43 | 142 |
2018 | 44 | 143 |
2018 | 45 | 144 |
2018 | 46 | 145 |
2018 | 47 | 146 |
2018 | 48 | 147 |
2018 | 49 | 148 |
2018 | 50 | 149 |
2018 | 51 | 150 |
2018 | 52 | 151 |
2019 | 1 | 122 |
2019 | 2 | 123 |
2019 | 3 | 124 |
2019 | 4 | 125 |
2019 | 5 | 126 |
2019 | 6 | 127 |
2019 | 7 | 128 |
2019 | 8 | 129 |
2019 | 9 | 130 |
2019 | 10 | 131 |
2019 | 11 | 132 |
2019 | 12 | 133 |
2019 | 13 | 134 |
2019 | 14 | 135 |
2019 | 15 | 136 |
2019 | 16 | 137 |
2019 | 17 | 138 |
2019 | 18 | 139 |
2019 | 19 | 140 |
2019 | 20 | 141 |
2019 | 21 | 142 |
2019 | 22 | 143 |
2019 | 23 | 144 |
2019 | 24 | 145 |
2019 | 25 | 146 |
2019 | 26 | 147 |
2019 | 27 | 148 |
2019 | 28 | 149 |
2019 | 29 | 150 |
2019 | 30 | 151 |
2019 | 31 | 152 |
2019 | 32 | 153 |
2019 | 33 | 154 |
2019 | 34 | 155 |
2019 | 35 | 156 |
2019 | 36 | 157 |
2019 | 37 | 158 |
2019 | 38 | 159 |
2019 | 39 | 160 |
2019 | 40 | 161 |
2019 | 41 | 162 |
2019 | 42 | 163 |
2019 | 43 | 164 |
2019 | 44 | 165 |
2019 | 45 | 166 |
2019 | 46 | 167 |
2019 | 47 | 168 |
2019 | 48 | 169 |
2019 | 49 | 170 |
2019 | 50 | 171 |
2019 | 51 | 172 |
2019 | 52 | 173 |
2019 | 53 | 174 |
Please help
you selected week and year or just week ?
and check the attached version
I can select anything. Either year or week. or both
Hello,
Try this
If(GetSelectedCount(Year)>0,
Sum({<[Week No]={">=$(=Min([Week No])) <=$(=Min([Week No])+14)"}>}Sales),
Sum({<[Week No]={">=$(=Max([Week No])-14) <=$(=Max([Week No]))"}>}Sales)
)
Regards,
Prashant
If I select any week like 3 or 4 in 2019, it has to show last 14 weeks starting from previous year. In your case, that is not happening.
Let's say I select 1st week of the current year, it has to give trends for last 13 weeks of last year and 1st week of current year
Create a week sequence field in the script and try like shown in attached sample.
this expression should work
=sum({<Year,[Week No],Year={"$(=max(Year))"},[Week No]={">=$(=max([Week No])-14)<=$(=max([Week No]))"}>}Sales)