Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI
I have a variable with two parameters, e.g. use 6 and 12 month back, and I use MonthSerial (you know max bla bla, I dont think it matters for this).
When I select in eg a year in the master calendar it works fine, but when all is clear, it does not know from where to count.
So I need to tell it that when nothing is selected take the max year.
What is the easiest way do to this?
Well, there you go. Embedding an aggregation function within an aggregation function will not work (in general, e.g without using advanced aggregation).
If you cleared all selection, what does your variable return? I would assume it's still working beacuse you are applying a ranges selection for MonthSerial based on Max(MonthSerial).
Would the GetPossibleCount() function help you ?
use the getselectedcount() function to know if a field is selected so write something like:
If(getselectedcount(myField)=0, Max(myField), getselectedfield(myField))
Well, I assume the max() function will also be your friend here.
But why don't you just post your variable definition and other relevant information, this would make it much easier to help.
I would used Max(Year) regardless of selection or no selection, because when there is no selection made it will choose the maximum year and when a selection is made it will choose the max from the available years. (Unless you don't want the max year when a selection is made, Max(Year) should work.
Best,
Sunny
Well I tried this:
if(getselectedcount(Year)<1,Round(sum({<MonthSerial={"=Max(MonthSerial)"}>} ($(Interval(6,12))))),Round($(Interval(6,12))))
it does not work. It should be able to translate from year to monthserial?
thx but I think getselectedcount() is better as suggested?
What is the definition of variable Interval(x,y)?
Seems like you included it into an aggregation, which will not work if it's an aggregation itself.
hmm, well yes that is probaly true, it works when I select.
The varaible is longer, I cannot show all, but it starts like this: ...((Sum({$<YearMonth,Year,Month,,MonthSerial={"<=$(=Max(MonthSerial)-$1)>=$(=Max(MonthSerial)-$2)"},...
so there you have the parameters.
Well, there you go. Embedding an aggregation function within an aggregation function will not work (in general, e.g without using advanced aggregation).
If you cleared all selection, what does your variable return? I would assume it's still working beacuse you are applying a ranges selection for MonthSerial based on Max(MonthSerial).