Conditionnal text with field from a base. if field=="P1" then write YES, else write NO

Hello Again,
I wish i could write conditionnal text, depending on a value of one field of my odb base.
I read the help text of LO, chose a field from database/mailing field menu, then on the Function menu, defined my condition and then text and else text.
But the printing only shows each value of the field, no text, then or else.
What is missing ? i am using LO 6.2.7.1.lin1 (x64).
And is there a limit to the text you may add ? whole paragraph or only few chars ?

regards
Peter
Annual_dbupgrade.odt (11.3 KB)
base.odb (4.2 KB)

It seems that the condition must be set with this syntax : [base.myquery.sql.site]==“value” , and then it works. I use a query to merge my tables.

It works on a test document, but not on the real one ??
Annual_dbupgrade.odt (11.4 KB)

I have a solution that works with a named global variable for my document, PF, and 2 hidden sections, each with the result depending on the environment. the first section for P1 is masked if PF EQ P2 and the second section is masked if PF NEQ P2, PF can only have these 2 values.

Cdlt
Typierre