Report syntax of comparaison

Hi there,

I have a problem to make a report (data export).

Here is my template:

{REPORT TICKET DETAILS:TT.CPN.asc,TT.CPT.sum,EC.Customers.DNI,EC.Customers.ID,T.TotalAmount,T.LastPaymentDate::{5}|SendDate|03|{0}|{3}|{2}|}

The value of EC.Customers.ID can be:

  • 1 (or, 0 or 6) in which case I need the value: 2020-01-29|SendDate|03|B001-48204|1|07921546|
  • Nothing (NULL, not filled) in which case I need “-”: 2020-01-29|SendDate|03|B001-48204|-|-|

So I plan to call the REPORT TICKET line 4 times with a comparaison on EC.Customers.ID

...:(EC.Customers.ID = "1"):...

I tried with or without parenthesis, with or without quote, with or without spaces, with or without brackets, with =, ==, !=, etc …
But all without success.

Customer.ID is an entity custom field, number.

Here is my full line:

{REPORT TICKET DETAILS:TT.CPN.asc,TT.CPT.sum,EC.Customers.DNI,EC.Customers.ID,T.TotalAmount,T.LastPaymentDate:(EC.Customers.ID = "1"):{5}|SendDate|03|{0}|{3}|{2}|PEN|{4}|0.00|0.00|0.00|0.00|0.00|0.00|0.00|{4}|||||||||1|}

And the result:

2020-01-29|SendDate|03|B001-48203|||PEN|36.00|0.00|0.00|0.00|0.00|0.00|0.00|0.00|36.00|||||||||1| 2020-01-29|SendDate|03|B001-48204|1|07921546|PEN|165.00|0.00|0.00|0.00|0.00|0.00|0.00|0.00|165.00|||||||||1|

I also tried to append:
::$5!=0:
with no success.

Any link to report syntax?

Marc

I’d look at the default item sales report where it has the portion not ‘Normal’ for ideas.

Ahh Yes, something like that:

([T.Price]*[T.Qty]).sum;'#.##;-#.##;-'

I’ll try - no luck

Also tried:

EC.Customers.ID != null
EC.Customers.ID!=null
EC.Customers.ID != 1
EC.Customers.ID!=1
(EC.Customers.ID != null)
(EC.Customers.ID!=null)
(EC.Customers.ID != 1)
(EC.Customers.ID!=1)

No luck

I think you need to remove the brackets.
As I said see default item sales. O.PortionName!=“Normal” without brackets.

I am in data export, without title.
Maybe that has an impact…
Or maybe because that field (Entity custom field) is not really a MSSQL field but a :face_with_head_bandage:JSON data

I tried with ’ and ", no luck
I tried with <, no luck

Test like
:T.TotalAmount > 0: works
:EC.Customers.ID > 0: don’t

ID is defined as number in entity custon field

Following the discussion from Formatting and Calculating on Entities CustomData Fields:

Emre says no formating, nor calculation (?Hence no check/comparaison?) on Entity custom fields

It’s an old post though, V4, 2014.
Is it still the case today?

EC.Customers.ID!=“1” ?

if you you might need to look at sql rather than report expressions