Hi Friends,
I am generating two weeks(current and previous) based on the user selected date. e.g.
When user selects 28th june, 28th june becomes the current week’s end date.
(current week - 22-28 june)
(previous week -15-21 june.)
When user selects 18th june, 18th june becomes the current week’s end date.
(current week - 12-18 june)
(previous week -5-11 june.)
my calculated field to get this custom weeks is-
addDateTime(extract('WD', ${SelectEndDate}), 'DD', truncDate('WK', {line_item_usage_date}))
now I would like to add sum of cost for each custom week and display that cost under each column of week, this is where I am stuck.
I tried to calculate it using this calculated field-
ifelse(
{line_item_usage_date} >= {cal_week_start_test} AND
{line_item_usage_date} <= {cal_week_end_test},
{line_item_unblended_cost},
0
)
but unfortunately it does not calculate the correct value. moreover when I add columns as week_start_date the value is shown for a single day.
in the screenshot below for the week 22-28 june the expeced values are shown for 22 june rather than sum of cost for (22-28 june)
Could you please help , how can we achieve the correct sum for custom weeks?
Thank you