Announcements
Marching toward a simplified navigation! READ ON
cancel
Showing results for
Did you mean:
Contributor II

## Set Analysis Formula with Parameter

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

i got an error. Unfortuanetly I can´t find the error for this

Thanks for your help!

6 Replies
Employee

Add single quotes to the parameter 3

Also, replace \$5 by \$3

Contributor II
Author

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

Employee

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.

Contributor II
Author

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 .

Employee

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.

Contributor II
Author

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

Community Browser