Reputation: 127
I'm using aws quicksight and would like to create a calculated field of the difference value between my rows (and not in a pivot table) so I can visualize the difference between each measure
for example i have this data-set:
2019-05-09T10:52:02.000Z 0.45556
2019-05-09T14:52:03.000Z 0.46766
2019-05-09T18:52:03.000Z 0.47887
.
.
.
.
And i would like to add a calculated field that will show:
2019-05-09T10:52:02.000Z 0.45556 0
2019-05-09T14:52:03.000Z 0.46766 0.0121
2019-05-09T18:52:03.000Z 0.47887 0.01121
.
.
.
The main goal is to visualize (line chart) the change per reading i am getting....
Is it possible to do?
Should I create additional data-set with custom SQL query and join them?
Appreciate the help!
Upvotes: 2
Views: 7771
Reputation: 8097
I believe you are looking for the difference
function that is available to analysis-level calculated fields:
https://docs.aws.amazon.com/quicksight/latest/user/difference-function.html
So for the dataset:
mytime mymetric
------------------------ -------
2019-05-09T10:52:02.000Z 0.45556
2019-05-09T14:52:03.000Z 0.46766
2019-05-09T18:52:03.000Z 0.47887
The definition for your new calculated field would be something like this:
difference(
sum( {mymetric} ),
[{mytime} ASC],
1
)
Upvotes: 1