Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
please provide a explanation on how can we create 20 days SMA in a load script. Have tried to search a lot but in vain.
Also have come across above function which can only be used in chart expressions, right? . please somebody shed a light on this.
You want generate 20 days? Please post an example of what the output should look like.
for the sake of simplicity, consider for the below example i need a 2 days SMA
input table is a table with a daily transaction table
| Name | Date(DD/MM/YYYY) | Amount |
|---|---|---|
| peter | 20/01/2017 | 200 |
| peter | 21/01/2017 | 100 |
| peter | 22/01/2017 | 300 |
| peter | 23/01/2017 | 400 |
| tom | 20/01/2017 | 450 |
| tom | 21/01/2017 | 220 |
| tom | 22/01/2017 | 100 |
| tom | 23/01/2017 | 50 |
now the output table should look like this
| Name | Date(DD/MM/YYYY) | Amount | SMA Amount |
|---|---|---|---|
| peter | 20/01/2017 | 200 | 200 |
| peter | 21/01/2017 | 100 | 150 |
| peter | 22/01/2017 | 300 | 200 |
| peter | 23/01/2017 | 400 | 350 |
| tom | 20/01/2017 | 450 | 450 |
| tom | 21/01/2017 | 220 | 335 |
| tom | 22/01/2017 | 100 | 160 |
| tom | 23/01/2017 | 50 | 75 |