22 Replies Latest reply: Mar 21, 2017 4:09 AM by Sunny Talwar

# Parameters in set analysis

Hi All,

When trying to use a parameter in the set analysis facing some issues.

below is the variable am creating

set vExpression =

num(Avg({<[KPI] = {\$1},Year=,Month=,Day=,[Date],[Date]={">=\$(=Num(\$(=vToDate& 'Start(Max(Date))'))) <=\$(=Max(Date))"}>} Actual),\$3)

and using =\$(vExpression ('KPI1','#.##')). But it's not working. When I placed it in straight table and hovered the expression

>=\$(=Num(\$(=vToDate& 'Start(Max(Date))'))) <=\$(=Max(Date)) is being showed as >= <=.

I also tried passing 'Start(Max(Date))' as \$3 . But the result is same.

The value of vToDate will be Day/Week/Month

Can someone explain what I am doing wrong.

• ###### Re: Parameters in set analysis

Where is \$2? You have used \$1 and \$3?

• ###### Re: Parameters in set analysis

Sorry Sunny,

At first i tried,

set vExpression =

num(Avg({<[KPI] = {\$1},Year=,Month=,Day=,[Date],[Date]={">=\$(=Num(\$(=vToDate& \$2))) <=\$(=Max(Date))"}>} Actual),\$3)

and used \$(vExpression ('KPI1','Start(Max(Date))','#.##')).

Later I tried ,

set vExpression =

num(Avg({<[KPI] = {\$1},Year=,Month=,Day=,[Date],[Date]={">=\$(=Num(\$(=vToDate& 'Start(Max(Date))'))) <=\$(=Max(Date))"}>} Actual),\$2)

and used \$(vExpression ('KPI1','#.##')).

Neither of them worked.

• ###### Re: Parameters in set analysis

Would you be able to share a sample?

• ###### Re: Parameters in set analysis

When hovered on the straight table, the value is incorrect.

• ###### Re: Parameters in set analysis

But where is \$2? I am not sure what the idea is here? Where does Start(Max(Date)) this go?

• ###### Re: Parameters in set analysis

In the variable vexpression code, you can find \$1,\$2,\$3. Am not sure if i missed anything.

• ###### Re: Parameters in set analysis

Got it... and what is vToDate here?

• ###### Re: Parameters in set analysis

Its value will be Day/Month/Year based on button clicks which i didnt implement in the sample qvw.

• ###### Re: Parameters in set analysis

Can you give me a static value to test this out?

• ###### Re: Parameters in set analysis

I think we can use something like

set vExpression =

num(Avg({<[KPI] = {\$1},Year=,Month=,Day=,[Date],[Date]={">=\$(=Num(\$(='Month'& \$2))) <=\$(=Max(Date))"}>} Actual),\$3)

and used \$(vExpression ('KPI1','Start(Max(Date))','#.##')).

• ###### Re: Parameters in set analysis

Check the attached now

• ###### Re: Parameters in set analysis

Can you please explain what was the issue?? Why does giving "\$" in the vexpression doesn't work.

• ###### Re: Parameters in set analysis

Check now

• ###### Re: Parameters in set analysis

I should have thought about converting it to date.  It works. Thank you Sunny.

• ###### Re: Parameters in set analysis

Awesome