Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have an SQL table that consists of Calendar data, in the said table I have a field fin_year (number e.g. 2011) and I use this field again to create a fin_year_str field (string e.g. FY2011). The problem is if I select on fin_year_str my chart doesn't generate the correct value, here's my expression:
( Sum({<fin_year={$(=Max(fin_year))}>}extended_price)
- Sum({<fin_year={$(=Max(fin_year)-1)}>}extended_price)
)
/ Sum({<fin_year={$(Max(fin_year)-1)}>}extended_price)
Why is this happening?
With a string, you need to use the maxstring() function instead of the max() function, something I've always found annoying.
Edit: Ah, you're selecting a string, but the set analysis is on the number. Never mind.
my filter is fin_year_str
and my set analysis is
( Sum({<fin_year={$(=Max(fin_year))}>}extended_price)
- Sum({<fin_year={$(=Max(fin_year)-1)}>}extended_price)
)
/ Sum({<fin_year={$(Max(fin_year)-1)}>}extended_price)
so if I select FY2011 in fin_year_str then fin_year = 2011, but the chart always give me 0 value
any idea?
Does it work if you select fin_year (not str) in a listbox? I know this is not the desired solution -- just a debugging question.
-Rob
yes sir. fin_year_str and fin_year are associated fields and came from the same table so i think my set anlysis should work. I'm using QV 11
Hi,
( Sum({<fin_year={$(=Max(fin_year))}>}extended_price)
- Sum({<fin_year={$(=Max(fin_year)-1)},fin_year=>}extended_price)
)
/ Sum({<fin_year={$(Max(fin_year)-1)},,fin_year=>}extended_price)
In your current syntax in the Max(fin_year)-1 in the set analysis you have to override the fin_year.
So when you click fin_year_str you got one year selected in the fin_year so set analysis won't work for the Max(year)-1.
Regards,
Nitin Jain