Calculating the time difference between current record and one immediately preceding it by user in Quicksight

0

For each record, I would like to calculate the time difference between that record date and the most recent previous record for that user. The goal is to calculate the number of days between user logins.

I was able to identify the last action date using the lag function:

Date of Previous Action (Tenant) = lag({action date [master]}, [{action date [master]} ASC], 1,[{tenant [master]}])

I think calculated the number of days between the current action and the previous one:

dateDiff({Date of Previous Action (Tenant)},max({action date [master]}),"DD")

I then obtained the following results:

Enter image description here

I am looking for a way to assign the number of days between actions for that user to each record, but I cannot figure out a way to do this. Does anyone have any suggestions?

Thank you so much in advance!!

  • You can try the formula timediff = LAG([timestamp], 1) - [timestamp] This formula calculates the time difference by subtracting the value of the timestamp column in the current row from the value of the timestamp column in the previous row. Add the calculated field to your QuickSight visualization. Use the calculated field to show the time difference between the current record and the one immediately preceding it.

JNiles
質問済み 1年前65ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ