Examine data for an empty field

474 views
Skip to first unread message

Buckstop

unread,
Jun 4, 2008, 9:08:36 AM6/4/08
to XMPie Interest Group
Just a quick question. Hopefully a very straight forward one for most
of you here.
I have a data file that has empty fields.
Using the IF ELSE combination I am unable to trigger an event on a
field being empty.
The XMPie menu does not give an IF <<FIELD>> = EMPTY option.
What are my alternatives?

Many thanks

Dave Cutts

unread,
Jun 4, 2008, 9:15:44 AM6/4/08
to xmpie...@googlegroups.com

If <field> = "" ?
If <field> = null
Theres another one I use but is escapes me

Buckstop

unread,
Jun 4, 2008, 10:44:49 AM6/4/08
to XMPie Interest Group
Thanks Dave that seemed to do the trick although we did try using null
and it did not work. Maybe you have to close and save everything and
then re open to flush rules out.

That got me through that problem but now I have run full speed into
this one!

FONT_REPRESENTATION_CREATION_FAILURE

Any clues?

Adam Luther

unread,
Jun 4, 2008, 11:50:24 AM6/4/08
to xmpie...@googlegroups.com
>> FONT_REPRESENTATION_CREATION_FAILURE

That's an odd one. Is this happening to all jobs, or is one particular file giving you trouble? Odds are it is font-specific, so I'd recommend looking at what you've loaded into uProduce and checking for any oddities.

Try isolating which font's causing the trouble. If nothing jumps out at you, try delete all the fonts loaded in the campaign, and adding them back one at a time. Between each upload process a small proof, and watch for the same error.


>> Thanks Dave that seemed to do the trick although we did try using null
and it did not work.

Properly detecting null values (if <field> = null) can be tricky, as some data formats do not reliably save that kind of information. I'd recommend against using NULL in the condition section of any logic, unless you can truly trust your data source (I'm hesitant to do it even then).

The safest way I've found to detect blanks using QLingo:

If (Length(Trim(|->[field])) = 0)


--
Adam Luther | VDP Graphic Artist

| | |
Modern Postcard
1675 Faraday Avenue, Carlsbad, CA 92008
tel: 800 959-8365 x1610 | fax: 760 602-1082
http://www.modernpostcard.com

SKipp

unread,
Jun 6, 2008, 10:41:35 AM6/6/08
to XMPie Interest Group
Thanks!, That's a great tip!

I've been using both "" and null
if (|->[LastName] = "" or |->[LastName] = null

sometimes a record will slip through if you only use one.

On Jun 4, 11:50 am, Adam Luther <ad...@modernpostcard.com> wrote:
> >> FONT_REPRESENTATION_CREATION_FAILURE
>
> That's an odd one.  Is this happening to all jobs, or is one particular file giving you trouble?  Odds are it is font-specific, so I'd recommend looking at what you've loaded into uProduce and checking for any oddities.
>
> Try isolating which font's causing the trouble.  If nothing jumps out at you, try delete all the fonts loaded in the campaign, and adding them back one at a time.  Between each upload process a small proof, and watch for the same error.
>
> >> Thanks Dave that seemed to do the trick although we did try using null
>
> and it did not work.
>
> Properly detecting null values (if <field> = null) can be tricky, as some data formats do not reliably save that kind of information.  I'd recommend against using NULL in the condition section of any logic, unless you can truly trust your data source (I'm hesitant to do it even then).
>
> The safest way I've found to detect blanks using QLingo:
>
> If (Length(Trim(|->[field])) = 0)
>
> --
> Adam Luther | VDP Graphic Artist
>
> | | |
> Modern Postcard
> 1675 Faraday Avenue, Carlsbad, CA 92008
> tel: 800 959-8365 x1610 | fax: 760 602-1082http://www.modernpostcard.com
>
>
>
> -----Original Message-----
> From: xmpie...@googlegroups.com [mailto:xmpie...@googlegroups.com] On Behalf Of Buckstop
> Sent: Wednesday, June 04, 2008 7:45 AM
> To: XMPie Interest Group
> Subject: [xmpie-users] Re: Examine data for an empty field
>
> Thanks Dave that seemed to do the trick although we did try using null
> and it did not work. Maybe you have to close and save everything and
> then re open to flush rules out.
>
> That got me through that problem but now I have run full speed into
> this one!
>
> FONT_REPRESENTATION_CREATION_FAILURE
>
> Any clues?
>
> On Jun 4, 2:15 pm, "Dave Cutts" <dave.cu...@imagedata.co.uk> wrote:
> > If <field> = "" ?
> > If <field> = null
> > Theres another one I use but is escapes me- Hide quoted text -
>
> - Show quoted text -

Tim Perrett

unread,
Jun 7, 2008, 5:42:04 AM6/7/08
to XMPie Interest Group
Bit of a late reply on this but I have been away at Drupa...

Whilst the question has been answered, you should note that its not
that using 'null' is bad, or that it doesn't work, its how the value
passes over the OLEDB bridge that dictates weather or not calling null
will actually get what you want.

e.g. For instance, if you were using SQL Server or other full RDBMS
which can properly support the notion of null, then it will work in
QLingo without problem. Excel on the other hand, has no idea what null
is so it would come across as being "" or such.

With regard to this code above:

Length(Trim(|->[field]))

That will of course only work with parameter type string, and will
need a AsString() type cast to make sure the function only gets passed
fully qualified strings.

Tim


Dave Cutts

unread,
Jun 7, 2008, 5:52:14 AM6/7/08
to xmpie...@googlegroups.com
Good reply tim, that explains a lot about why there is some differences
when using empty values from different datasources.

I had a problem using an excel database where using "" wasn't working
but using null was, so now I just use both together: if (|->[Field] = ""
or |->[Field] = null { 0 } else { 1 }

Reply all
Reply to author
Forward
0 new messages