6 Replies Latest reply: Jan 15, 2013 7:19 AM by Stefan Wühl

# Set Analysis - using FieldValue function

Hi

This formula works:

sum({<MEASURE_DESC = {'Profit Growth'}>} KPI)

But, if I try this formula it does not. Can you use the FieldValue function in set analysis?

sum({<MEASURE_DESC = {"=Fieldvalue('MEASURE_DESC',1)"}>} KPI)

Thanks

• ###### Re: Set Analysis - using FieldValue function

Try

sum({<MEASURE_DESC = {"\$(=Fieldvalue('MEASURE_DESC',1))"}>} KPI)

• ###### Re: Set Analysis - using FieldValue function

Hi Stefan

It works, thankyou, but it shows the formula as an error?

• ###### Re: Set Analysis - using FieldValue function

The syntax checker probably gets confused by the multiple single quotes (note that I change my expression to use double and single quotes, while single quotes only were my first approach and could / should work, too).

You can also create a variable:

vMeasureDesc

=Fieldvalue('MEASURE_DESC',1)

and use the variable in the expression:

sum({<MEASURE_DESC = {'\$(vMeasureDesc)'}>} KPI)

• ###### Re: Set Analysis - using FieldValue function

for my own understanding, why would the formula only work if you include the \$ expansion?

• ###### Re: Set Analysis - using FieldValue function

The \$(= tells QV to evaluate the expression, and match the result of the evaluation. Otherwise, it is trying match the string "=Fieldvalue('MEASURE_DESC',1)" (not evaluated).

Regards

Jonathan

• ###### Re: Set Analysis - using FieldValue function

You need a dollar sign expansion if you want to dynamically retrieve a value (literal) for your field value list in your set modifier.

If you want to use an advanced search (like, in your OP, using {"=expression"} ), I think you can write it like this:

=sum({<MEASURE_DESC = {"=MEASURE_DESC=fieldvalue('MEASURE_DESC',1)"}>} KPI)

which is an advanced search using a record based comparison. I would prefer using the dollar sign expansion variant.

Hope this helps,

Stefan