Date: prev next · Thread: first prev next last
2019 Archives by date, by thread · List index


I think I have a solution. I did some research on the Pentaho report generator that is used in the LO Base Report Generator with emphasis on their formula syntax. The following formula placed in the report field's properties "Data" tab in "Data field..." seems to do what I need:

IF(LEN([Suffix])>0;"-"&[Suffix] ;"")

This tests the length of the text string (Suffix) and if not 0 then outputs the string prefixed with a dash. The ampersand (&) concatenates text strings. If the string length is zero, it outputs the NULL string. I tried outputting the string here without the dash to be sure I got all data, as in:,

IF(LEN([Suffix])>0;"-"&[Suffix] ;[Suffix])

but it fails for some reason, outputting "false"  when the string length is 0 instead.

As I said, it seems to be working, unless I breathe on it!

Thanks for all the suggestions.

On 5/15/19 3:17 PM, Girvin Herr wrote:

I am using LibreOffice on Slackware Linux 14.2 (K4.4.75).

I have a database with a text field which may or may not be null. What I want to do is to prefix a dash "-" before the text if the text field is not null. At first, I tried this format:


Somewhere, not by me, it got changed to:


However, this does not work. I get the text when not null, but not the dash in either case.

Is there another way to do this?


Girvin Herr

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
Privacy Policy:


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.