Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I’m working on a Pivot Table that shows MTD P&L by month for the selected date. Here’s what I’m trying to achieve:
Use Case:
RangeSum( //YTD to PMTD
Sum({
<
Date = {">=$(=YearStart(Max(Date)))<=$(vPriorMonthEnd)"},
[Month End (Y/N)] = {'Y'},
Year_Reporting = {"$(vMaxYear)"}
>
}
If([Facility Class Type for HYSL Report] <> 'Protection' and [Hedge Type] = 'Hedged' and FundStrategy = 'HY - Europe',
MtdPnlEur * $(vHedgeRatioPerRow),
MtdPnlEur
)
),
Sum({ //SelectedDate
<
Date = {"$(vMaxDate)"}
>
}
If([Facility Class Type for HYSL Report] <> 'Protection' and [Hedge Type] = 'Hedged' and FundStrategy = 'HY - Europe',
MtdPnlEur * $(vHedgeRatioPerRow),
MtdPnlEur
))
)
here this uses the max date in the database for the mentioned table.
Sum({$<Year=, Month=, Day=,
Date={">=$(=date(monthstart(max(Date))))<=$(=date(max(Date)))"}>}
Values
with Monthstart --> we will autopick the first date of the latest month.
then we will take the max date available in the table.
feel free to revert in case anything.
RangeSum( //YTD to PMTD
Sum({
<
Date = {">=$(=YearStart(Max(Date)))<=$(vPriorMonthEnd)"},
[Month End (Y/N)] = {'Y'},
Year_Reporting = {"$(vMaxYear)"}
>
}
If([Facility Class Type for HYSL Report] <> 'Protection' and [Hedge Type] = 'Hedged' and FundStrategy = 'HY - Europe',
MtdPnlEur * $(vHedgeRatioPerRow),
MtdPnlEur
)
),
Sum({ //SelectedDate
<
Date = {"$(vMaxDate)"}
>
}
If([Facility Class Type for HYSL Report] <> 'Protection' and [Hedge Type] = 'Hedged' and FundStrategy = 'HY - Europe',
MtdPnlEur * $(vHedgeRatioPerRow),
MtdPnlEur
))
)
I used RangeSum to calculate YTD to PMTD values first means Jan 2025 to June 2025 and then in other I calculated just Selected Date which will come under July 2025
MonthYear is in my Pivot Columns. Tricky but at the end, It was worth learning it.