Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to show value of Last period last period in a bar chart which will contain all periods in a year selected. when i am applying this expression Sum(
{<
[QP_PARENT4] = {'abc'},
PERIOD_YEAR_GB = {"$(=Max(PERIOD_YEAR_GB))"},
PERIOD_NUM = {"$(=Max({<PERIOD_YEAR_GB={"$(=Max(PERIOD_YEAR_GB))"}>} PERIOD_NUM)-1)"},
ENTERED_PERIOD_NAME =
>}
CLOSING_BALANCE
)
It is only showing me one bar of one month . while i want all months in one plot.
sample data and expected output ?
Try with the addyears function in your expression to show the values associated to the previous year. For example, like this : PERIOD_YEAR_GB = {"$(=AddYears(PERIOD_YEAR_GB,-1))"}, with PERIOD_YEAR_GB like your year field.
lets say you have data:
data:
load * inline [
YearMonth,Value
2024-Jan, 10
2024-Feb,20
2024-Mar,20
2024-Apr,40
2024-May,20
2024-Jun,25
2024-Jul,15
2024-Aug,60
2024-Sep,50
];
UI: st table:
Dim:YearMonth
Measure1: CurrMonth =sum(Value)
Measure2: PrevMonth = if(isnull(Above(Sum(Value))), 0, Above(Sum(Value)))
Measure3: % =Num((PrevMonth-CurrMonth)/PrevMonth, '##.##%')
something like this?
Your set analysis is filtering the entire chart to one period (Max year + Max period − 1), so you only get a single bar; to show all months while displaying the previous period’s value per bar, use a row-wise function instead of set analysis, e.g. sort the chart by PERIOD_NUM ascending and use: =RangeSum( Above( Sum({<[QP_PARENT4]={'abc'}, PERIOD_YEAR_GB={'$(=Max(PERIOD_YEAR_GB))'}>} CLOSING_BALANCE), 1, 1 ) ) — this returns the value from the prior period for each month while keeping every month visible; if you instead want a flat reference line of the last period’s value across all bars, add a second measure like =Only( Total Sum({<[QP_PARENT4]={'abc'}, PERIOD_YEAR_GB={'$(=Max(PERIOD_YEAR_GB))'}, PERIOD_NUM={'$(=Max(PERIOD_NUM))'}>} CLOSING_BALANCE) )