Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Displaying a character based on logical expression
LV123
Hi,
Newbie here. I have a data control field that is of type boolean. I need to display a character based on its value e.g. 0 = N, 1 = Y.
Not sure how to accomplish this, I've been trying to do it from the script tab/editor for the field specifically. Also tried it from the expression builder. Tried javscript something like:
If (dataSetRow["eoctrack01_85"]=="1")
{
Document.write("Y")
}
No luck.
Really out of my area here, your help is appreciated.
Find more posts tagged with
Comments
Bsupport
Hi,<br />
<br />
Do 1 thing let the Boolean data field (dataSetRow["eoctrack01_85"]) be there in the table. Just hide that data field and take another data field beside it with data type as string and write the following in its exprsseion:<br />
If (dataSetRow["eoctrack01_85"]==1)<br />
{<br />
“YES”;<br />
}<br />
Else<br />
{<br />
“NO”;<br />
}<br />
<br />
I think this will solve ur query.<br />
<br />
<br />
Regards,<br />
Birtsupport<br />
<a class='bbc_url' href='
http://www.reportinghouse.com'>Reporting
House: Our Focus...Your Reports</a>
LV123
Thank you,
Received syntax errors with the code above, so I removed the quotes:
If (dataSetRow["eoctrack01_85"]==1)
{
YES;
}
Else
{
NO;
}
Still receiving errors in preview:
Script source: {1}, line: 61,910, text:
<compiled script>. See next exception for more information.
Error evaluating Javascript expression. Script engine error: ReferenceError: "If" is not defined.
Script source: {1}, line: 61,910, text:
<compiled script>
KavithaD
Hi LV123,
Let the table be bind to respective data set row,In the binding give expression like this,
let that data type be string,
if (dataSetRow["STUDY_STATUS"]=="2")
{
dataSetRow["STUDY_STATUS"]="YES";
}
else{
dataSetRow["STUDY_STATUS"]="NO";
}
Hope this may solve your problem.
Thanks & regards
Kavitha
LV123
Kavitha,
Yes problem solved! This works perfectly.
Thank you for this valuable information.
Kind regards.
ALV123