2 Replies Latest reply: Feb 22, 2012 3:21 AM by Thomas Ljungström

# replace parameter in set analysis

Hi!

I'm loading a fair amount of expressions to calculate stuff. However, the expressions are quite the same with just a parameter different. How to create a 'standard' expression and then in my chart supply the parameter?

This is what I have:

```vBelopp_a=sum({\$<Region_own={[ON-US]},PosEntryDesc={Annat}>}Transbelopp)
vBelopp_c=sum({\$<Region_own={[ON-US]},PosEntryDesc={Chip}>}Transbelopp)

```

I would like to write:

```vBelopp=sum({\$<Region_own={[ON-US]},PosEntryDesc={\$1}>}Transbelopp)

```

and then supply the parameter in chart like:

```\$(vBelopp('{Annat}'))
\$(vBelopp('{Chip}'))
```

I can't get the syntax right (if it's possible to do like this...).

Thanks

• ###### replace parameter in set analysis

Hi,

Try with  this

`vBelopp=sum({\$<Region_own={[ON-US]},PosEntryDesc=\$1>} Transbelopp)`

Then use

`\$(vBelopp('{Annat}'))\$(vBelopp('{Chip}'))`

Celambarasan

• ###### Re: replace parameter in set analysis

Thanks Celambarasan, but no. But it got me continue and this is how you do it:

```The variable:
sum({\$<Region_own={[ON-US]},PosEntryDesc={\$1}>}Transbelopp)

The expression:
\$(vBeloppRegion_annat('Annat'))
```

Extend with more parameters:

```The variable:
sum({\$<Region_own={\$2},PosEntryDesc={\$1}>}Transbelopp)

The expression:
\$(vBeloppRegion_annat('Annat','ON-US'))
```