Hello Experts,
we have a requirement to build the below logic in Webi Report. Please help me with finding the logic to calculate Amounts for the previous month and year

Prompt Date is 8/1/2019 - 8/31/2019 (always run for the month)

Column 1: Date (8/1, 8/2, 8/3, 8/4…8/31)

Column 2: Amount (100, 200, 300,… 1,000)

Column 3: Previous Month Amount (I don’t how to calculate) need help on this

Column 4: Amount should calculate from Jan/2019 to Aug/2019 (This should dynamically work based on prompt. let’s say if I pick March then it should go back and calculate from Jan to March)

Column 5: same as Column 4 but it need to calculate previous year

Attached Sample screenshot for better understanding.

Thank you for the Function. how can I sum the amount based on the previous date?

Here is my logic, which I wrote in the Variable and it has some data type issue.

=Sum([RWBTR]) Where (RelativeDate([ZALDT];-1;MonthPeriod))

Object Qulaification:
RWBTR = (Qualification = Measure, Type = Number, and Aggrative function = sum in the universe)
(tried changing Qualifcation = Dimension and Type = Number still no luck)

Now I’m able to show the previous month from “ZALDT” Object but unfortunately, the Amount is not working with the previous month. Can you please help me out on that particular logic.

Tried something like this and it got datatype issue:
=Sum([RWBTR]) Where (RelativeDate([ZALDT];-1;MonthPeriod))