<p>Hi -</p>
<p> </p>
<p>I'm new to BIRT and I'm trying to build an aggrigate based on a condition. I've got the following Fields:</p>
<p> </p>
<p>PLAN1</p>
<p>PLAN1_VALUE</p>
<p>PLAN2</p>
<p>PLAN2_VALUE</p>
<p>PLAN3</p>
<p>PLAN3_VALUE</p>
<p> </p>
<p>I need to write a condition as follows:</p>
<p> </p>
<p>If PLAN1 = 'SALES' then PLAN1_VALUE ELSE 0 END IF;</p>
<p>+</p>
<p>If PLAN2 = 'SALES' then PLAN2_VALUE ELSE 0 END IF;</p>
<p>+</p>
<p>If PLAN3 = 'SALES' then PLAN3_VALUE ELSE 0 END IF;</p>
<p>+</p>
<p>If PLAN4 = 'SALES' then PLAN4_VALUE ELSE 0 END IF;</p>
<p> </p>
<p>I'm getting an error when trying to write the expression. I'm new to javascript

</p>
<p>I can get the one condition to work, but I'm running into a problem with adding them together.</p>
<p> </p>
<p><b>if</b> (dataSetRow["PLAN1"] = 'Sales' ){</p>
<p>dataSetRow["PLAN1_VALUE"];</p>
<p>}</p>
<p><b>else</b> {</p>
<p>0;</p>
<p>}</p>
<p>+</p>
<p><b>if</b> (dataSetRow["PLAN12] = 'Sales' ){</p>
<p>dataSetRow["PLAN2_VALUE"];</p>
<p>}</p>
<p><b>else</b> {</p>
<p>0;</p>
<p>}</p>
<p> </p>
<p>You're help would be greatly appreciated!</p>
<p>+</p>
<p><b>if</b> (dataSetRow["PLAN3"] = 'Sales' ){</p>
<p>dataSetRow["PLAN3_VALUE"];</p>
<p>}</p>
<p><b>else</b> {</p>
<p>0;</p>
<p>}</p>