Help with Quicksight Calculated Field for Timeseries aggregate Values

0

Imagine if we have a time series values like this, lets say the timestamps are in epoch and device is emitting a payload every minute.

timestampdevicesensorNamesensorValue
1612828800001device1modeRunning
1612828800001device1fuelUsed23
1612828800011device1modeRunning
1612828800011device1fuelUsed33
1612828800021device1modeRunning
1612828800021device1fuelUsed50
1612828800002device1modeNot Running
1612823800002device1fuelUsed45
1612828800002device2modeRunning
1612823800002device2fuelUsed77

And we would like to know what was the TotalfuelUsed in the last 30 days when the mode was Running (mode Not Running means engine is on but not moving = idle). We tried using calculated field and periodToDateAvg function but somehow it is just not possible to do this complex query in one or multiple calculations

  • Calculated Field 1: Productive Productive time = sum(periodToDateAvg({sensorName} = 'mode' and {sensorValue} = 'Running', Month )) <<<---- Need help here

  • Calculated Field 1: TotalFuelUsedDuringProductive TotalFuelUsedDuringProductive = TotalFuelUsed/Productive

  • Expected Output device1 TotalFuelUsedDuringProductive = (50-23)/(3-2)

Is this even possible to do in Quicksight? or do we have to use Athena SQL Query?

jinman
질문됨 2년 전160회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠