Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi folks,
I got to calculate daily Sum of Value based on IDs available on each date. Basically initial table looks like:
| ID | Value | StartDate | EndDate |
|---|---|---|---|
| 1 | 100 | 01.01.2017 | 04.01.2017 |
| 2 | 110 | 01.01.2017 | 05.01.2017 |
| 3 | 120 | 02.01.2017 | 03.01.2017 |
| 4 | 130 | 01.01.2017 | 08.01.2017 |
| 5 | 140 | 03.01.2017 | 05.01.2017 |
| 6 | 150 | 06.01.2017 | 09.01.2017 |
| 7 | 160 | 07.01.2017 | 09.01.2017 |
| 8 | 170 | 05.01.2017 | 08.01.2017 |
| 9 | 200 | 08.01.2017 | 09.01.2017 |
| 10 | 300 | 03.01.2017 | 05.01.2017 |
And as the outcome I need to get:
| Date | Value (Date>=StartDate and Date<= EndDate) |
|---|---|
| 01.01.2017 | 340 (100+110+130) |
| 02.01.2017 | 460 |
| 03.01.2017 | 900 |
| 04.01.2017 | 780 |
| 05.01.2017 | 850 |
| 06.01.2017 | 450 |
| 07.01.2017 | 610 |
| 08.01.2017 | 810 |
| 09.01.2017 | 510 |
Is it possible to do such calculation in visualization (not in the script?), and if not how can I incorporate this into the model (so when I choose a certain date, associated IDs which constitute the Value sum are selected) ?
Would appreciate any help
Thank you Sunny, tried both of those methods and both worked ![]()
it's sum of Values for IDs: 1, 2, 3, 4, 5, 10, so 100+110+120+130+140+300