Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have month wise data , and i want to apply YTD using bar chart. and m nt able to understand what vl b expression for YTD condition?
Hi,
Try using the modified expression as below.
Sum({$<YEAR = {
$(varMaxYear)
}, MONTH={"<=$(#varMaxMonth)"}>} Amount).
or somthing like this.
Sum({$<YEAR = {$(varMaxYear)
}, MONTH={"<=$(#=varMaxMonth)"}>} Amount).
Regards
Hudson
Hi,
The Expression which Anant has given should work but it may need a little modification.
To make it work properly if you have data for more than 1 year, you also need to pass year.
varMaxMonth = Max(MONTH)
varMaxYear = Max(YEAR)
Sum({$<YEAR = {
$(varMaxYear)
}, MONTH={"<=$(varMaxMonth)"}>} Amount)
yah tat rights, after adding Year condition the expression will be all right,
Thanks paliwal
but in my main table m havin period field instead of year and month. and its in d format of,
Apr09
Mar11
jan12...........
and i connected this period field with my main calender's field and in ur expression i used my calender fields as year and month then m nt getting ny data........ y it so??
yojas
Hi,
Try using the modified expression as below.
Sum({$<YEAR = {
$(varMaxYear)
}, MONTH={"<=$(#varMaxMonth)"}>} Amount).
or somthing like this.
Sum({$<YEAR = {$(varMaxYear)
}, MONTH={"<=$(#=varMaxMonth)"}>} Amount).
Regards
Hudson
Monthfield
Apr09
Mar11
jan12...........
left(Monthfield),3 as Month.
Num(20&right(Monthfield,2)) as Year
Load * inline [
Month,MonthNo
Jan,1
Feb,2
Mar,3
Apr,4
May,5
Jun,6
Jul,7
Aug,8
Sep,9
Oct,10
Nov,11
Dec,12
];
and use below formula
varMaxMonth = Max(MonthNo)
varMaxYear = Max(YEAR)
Sum({$<YEAR = {
$(varMaxYear)
}, MONTH={"<=$(varMaxMonth)"}>} Amount)
hope this helps
Thanks....