简体   繁体   中英

AWS QuickSight - create a calculated field of the difference between a measure based fields

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!

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
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM