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)
computed column issue
dhausman
I am creating a computed column
if (BirtComp.equalTo(row["open_days"], "0")) {"<1"} else
if (BirtComp.equalTo(row["open_days"], "1")) {"1"} else
if (BirtComp.equalTo(row["open_days"], "2")) {"2"} else
if (BirtComp.equalTo(row["open_days"], "3")) {"3"} else
if (BirtComp.equalTo(row["open_days"], "4")) {"4"} else
if (BirtComp.equalTo(row["open_days"], "5")) {"5"} else
if (BirtComp.between(row["open_days"], "6", "14")) {"6-14"} else
if (BirtComp.between(row["open_days"], "15", "29")) {"15-29"} else
if (BirtComp.between(row["open_days"], "30", "44")) {"30-44"} else
if (BirtComp.greaterOrEqual(row["open_days"],"45")) {">45"}
else {"ERROR"}
If I have a value in the open day equal to 11 it will report error however when I check Syntax there is no problem. Any ideas? My other ranges 15-29 and 30-44 work fine.
I am using Birt 2.6.1
Dan
Find more posts tagged with
Comments
Hans_vd
That seems perfectly normal.<br />
The <strong class='bbc'>string</strong> "11" doesn't fit in any of the categories.<br />
<br />
You should be working with numbers instead of strings.<br />
Or else you could try adding a zero before 6, like this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>...
if (BirtComp.between(row["open_days"], "06", "14")) {"6-14"} else
...</pre>
dhausman
Ah, ok I kind of overlooked that I was treating it as a string. thanks!