Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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={'A'}>}cost)*(1+vAdelta)
+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
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={'A'}>}cost)*(1+vAdelta)*vA
+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
=sum({$<ITEM={'A'}>}cost)*If(GetFieldSelections(ITEM)='A',vAdelta+1,1)
and so on
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={'A'}>}cost)*(1+vAdelta)*vA
+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