Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Multiply 2 column values with filters
dsrikanth
Hi to all,<br />
<br />
In my requirement i am calling 2 functions through query which yield 2 columns. Now i need to show these 2 columns along with another column by multiplying these 2 columns. Any one of these 2 columns may give null, so that while multiplying them i need to put some condition (if null take 0).<br />
<br />
I tried it <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>Column1 || Column2 || Result
dataSetRow["UNITSTOCKQTY"] || dataSetRow["RATE"] || dataSetRow["UNITSTOCKQTY"]*dataSetRow["RATE"]</pre>
<br />
<br />
But it is not working.]<br />
Any suggestions would be appreciated.<br />
<br />
Thanks in advance,<br />
Srikanth D
Find more posts tagged with
Comments
mwilliams
Write your query to just return the 2 columns. Then, in your dataSet editor, go to the computed column section and create a new computed column. In your expression, put something like:
if (row["UNITSTOCKQTY"] == null || row["RATE"] == null){
0;
}
else{
row["UNITSTOCKQTY"] * row["RATE"];
}
That should do it.
dsrikanth
Thanks for the reply williams,
Srikanth D
mwilliams
Not a problem. Let us know whenever you have questions!