Created
November 6, 2017 23:15
-
-
Save menduz/10eceb52fe618af3faf002ddedaf8a45 to your computer and use it in GitHub Desktop.
DataWeave SMA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 2.0 | |
output application/json | |
fun sma(list: Array<Number>, window: Number) = | |
0 to (sizeOf(list) - window) map ($ to $ + window - 1) map avg(list[$]) | |
--- | |
sma([90, 40, 45, 100, 101], 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment