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)
Display Default Data
drewsheez
Hello!
I have a report (please see attached image - censored for privacy purposes)setup that uses multiple queries. One for Patient Demographic/Visit information, and another for documented data on the Patient. I have patient demographics at the top of the report, and documented data in the middle. I have used tables with filters to associate with the correct patient. In the table, there are multiple data values where data may or may not be present for the specific patient in question. I am able to map data to specific values when it exists for the patient, but cannot seem to figure out how to display a value if no data is found for that specific value. I have mapped the value where it is equal to "" and to where the value is NULL and the report still displays a blank field.
Are there any ways to dislpay a default value if no data exists for a field, or would I be able to perform something like an if/else statement on the field where if data exists, display that value, else display a default value?
Thanks in advance for any information!
Drew
Find more posts tagged with
Comments
KavithaD
Hi drewsheez,
for the dataset column you can do some thing like this showed below,double click on the data set column
in expression click on fx icon,
there you can write if else condition
if(dataSetRow["STATUS"] == null){
dataSetRow["STATUS"] = "default value";
}else{
dataSetRow["STATUS"] = dataSetRow["STATUS"];
}
Hope this may help you.
Thank you,
Kavitha
drewsheez
Hi Kavitha,
Thank you for the response!
I have been on Jury Duty for the pasty few weeks and am just getting back in the office. I have tried what you had suggested, but it still does not work. So, I did a little experiment. This might get a little confusing and I apologize.
Since each of areas could potentially have multiple values, I had placed a table with one column for each of the fields. (For example, I have created a table with two columns, one row specifically containing the words "Current Home Care Services:" in one column, and a table with one column containing the data from the query in the second column, see the screen shot in original post as a reference.) This way if there are multiple values, it will show all of the values rather than just one. The experiment I performed was setting the background color of this table for the field, and what I found was that the background color only displays when data is displayed. When a blank field is displayed, no background color is displayed, and it is actually due to not finding a corresponding value in the database, as in there are no rows returned by the query rather than a NULL value. Therefore, when a blank field is displayed, the table is not displaying at all and the approach for mapping with a NULL value will not work. Any ideas how I might go forward with poroviding a default value in this area from here?
Thanks,
Drew
thuston
<a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/20094-how-to-check-whether-the-resultset-of-a-query-is-null/'>http://www.birt-exchange.org/org/forum/index.php/topic/20094-how-to-check-whether-the-resultset-of-a-query-is-null/</a><br
/>
<a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/20146-display-empty-table-message-when-there-is-no-record-in-table/'>http://www.birt-exchange.org/org/forum/index.php/topic/20146-display-empty-table-message-when-there-is-no-record-in-table/</a><br
/>
<br />
You can create Label in the nested Table's HeaderRow and set the Visibility to only show when no data is returned.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>row.__rownum >= 0
//If there are no rows it returns -1 and the label will appear.</pre>
drewsheez
Thanks thuston! Worked flawlessly!
Too bad I didn't have the so called "Easy Button" earlier!