Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have build a QVD with 2 years of data in date lavel and now wanted to build a logic like this | ||||||
The formula should be Sum(Txn current date)/Average(last 14 days excluding current date) – 1 | ||||||
Example: | ||||||
10/3/2016 Txn should be compared to average of Txn from (10/2/2016 – 09/19/2016) | ||||||
10/2/2016 Txn should be compared to average of Txn from (10/1/2016 – 09/18/2016) | ||||||
10/1/2016 Txn should be compared to average of Txn from (09/30/2016 – 09/17/2016) |
Sample Data:
Txn | 10/15/2016 | 10/14/2016 | 10/13/2016 | 10/12/2016 | 10/11/2016 | 10/10/2016 | 10/9/2016 | 10/8/2016 | 10/7/2016 | 10/6/2016 | 10/5/2016 | 10/4/2016 | 10/3/2016 | 10/2/2016 | 10/1/2016 | 9/30/2016 | 9/29/2016 | 9/28/2016 | 9/27/2016 | 9/26/2016 | 9/25/2016 | 9/24/2016 | 9/23/2016 | 9/22/2016 | 9/21/2016 | 9/20/2016 | 9/19/2016 | 9/18/2016 | 9/17/2016 | 9/16/2016 | 9/15/2016 | 9/14/2016 | 9/13/2016 | 9/12/2016 | 9/11/2016 | 9/10/2016 |
Partner A | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 |
Partner B | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 |
Partner C | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 |
Partner D | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 |
Required output:
Result Set (will always display latest 15 days) | |||||||||||||||
Date -> | 10/15/2016 | 10/14/2016 | 10/13/2016 | 10/12/2016 | 10/11/2016 | 10/10/2016 | 10/9/2016 | 10/8/2016 | 10/7/2016 | 10/6/2016 | 10/5/2016 | 10/4/2016 | 10/3/2016 | 10/2/2016 | 10/1/2016 |
Partner A | 93.0% | 93.1% | 93.2% | 93.2% | 93.3% | 93.3% | 93.4% | 93.4% | 93.5% | 93.6% | 93.6% | 93.7% | 93.7% | 93.8% | 93.8% |
Partner B | 97.4% | 97.4% | 97.4% | 97.4% | 97.4% | 97.4% | 97.4% | 97.4% | 97.4% | 97.4% | 97.4% | 97.5% | 97.5% | 97.5% | 97.5% |
Partner C | 87.0% | 87.2% | 87.4% | 87.6% | 87.8% | 88.0% | 88.2% | 88.4% | 88.5% | 88.7% | 88.9% | 89.1% | 89.2% | 89.4% | 89.5% |
Partner D | 95.9% | 96.0% | 96.0% | 96.0% | 96.0% | 96.0% | 96.1% | 96.1% | 96.1% | 96.1% | 96.1% | 96.2% | 96.2% | 96.2% | 96.2% |