Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi together,
I have the following Set Analysis Formula with Parameters:
fCount =Count({$< Field1 = {'$1'}, Field2 = {'$1'}, Date = {$(=$5)} > } [Value] )
If I set the values and variables directly into the formula, like
fCount =Count({$< Field1 = {'value1'}, Field2 = {'value2'}, Date = {$(=$(vD_AddXMonthsRange(-6)))} > } [Value] )
it works. But if I want to use the formula with Parameters, like
=$(f_Count(value1,value2,$(vD_AddXMonthsRange(-6))))
i got an error. Unfortuanetly I can´t find the error for this
Thanks for your help!
Add single quotes to the parameter 3
=$(f_Count(value1, value2, '$(vD_AddXMonthsRange(-6))'))
Also, replace $5 by $3
Hey Miguel,
thanks for you reply. Unfortunately it not helps.
For better understanding, followed my formula for vD_AddXMonthsRange:
CHR(39) & '>=' & AddMonths(vD_CurrentDateInput, $1) & '<=' & vD_CurrentDateInput & CHR(39)
I used $1, $2 and $3. It was only a mistake in my post
Best regards
Is the output of the AddMonths() function in the same format than the field "Date"?
Also, always use Chr(34) or " when the right side of the set modifier is a search (in this case, a range) and not a fixed value.
Hey Miguel,
the format from the AddMonths function is in the same Format. Please find attached my Test-Application about this problem.
I tried to use Chr(34), but I have the same problem .
I would go for modifying the fSum variable to
Sum({$<
Field1 = {'$1'},
Field2 = {'$2'},
Datum = {">=$(=AddMonths(Datum, $3))<=$(=Date(Max(Datum)))"}
>}
[Value]
)
The expansion within the expansion, while maybe possible, is returning already calculated values instead of text. This expression above in the fSum will work, though.
Hi Miguel, thanks for your response.
Unfortunately, if I use this formula I´m not so flexible, because I don´t want only use formulas like the AddXMonths, I want to use also some other formulas for set the Date Parameter