From the above screenshot
i have selected timeline between 2024-01-01 to 2024-01-20
so in current_period_sales it needs to display the selected time range aggregated sales(sum) and
in last30days_sales it needs to display the selected time range - 30 days aggregated data (which means the data of 2023-12-02 to 2023-12-21).
can i get a logic how to create these calculated columns in quicksight
Hi,
so if you use date filter on visual it will only show data for that specific time period. so cannot visualize last 30 days data in table.
for this you need to create custom filter in calculated field. here are the steps.
create startdate and enddate parameters and add controls on sheet.
write calculated field for current period sales.
ifelse(
Date >= ${startdate} AND Date <= ${enddate}
,{Weighted Revenue},0)
And for last 30 days use this calculated field.
ifelse(
Date >= addDateTime(-30, ‘DD’,${startdate}) AND Date <= addDateTime(-30, ‘DD’,${enddate})
,{Weighted Revenue},0)
use these two calculations in your table with the palyer_id in dimension section
Hope this will help
Thanks