2 Replies Latest reply: Jul 13, 2015 5:13 AM by sushil kumar

# Multi variable help requested

Hi, i need a help to solve my problem:

i'm making a simulation on changing of costs, not only 1 variable but as many as items in my catalogue:

+sum({\$<ITEM={'B'}>}cost)*(1+vBdelta)

+sum({\$<ITEM={'C'}>}cost)*(1+vCdelta)

+sum({\$<ITEM={'D'}>}cost)*(1+vDdelta)

+sum({\$<ITEM={'E'}>}cost)*(1+vEdelta)

this is perfect if i'm calculating TOTAL, but if a select only 1 item, how can i have only ONE cost simulation?

Thanks

• ###### Re: Multi variable help requested

and so on

• ###### Re: Multi variable help requested

Hi,

You can add another variable having values 0 or 1 and then assign the value of variable as 1 as per the selection.

+sum({\$<ITEM={'B'}>}cost)*(1+vBdelta)*vB

+sum({\$<ITEM={'C'}>}cost)*(1+vCdelta)*vC

+sum({\$<ITEM={'D'}>}cost)*(1+vDdelta)*vD

+sum({\$<ITEM={'E'}>}cost)*(1+vEdelta)*vE

Create variable as vA = Alt(substringcount(getfieldselection(ITEM),'A'),0)

vB = Alt(substringcount(getfieldselection(ITEM),'B') ,0)

and so on..

HTH

Sushil