-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
Paradox To/From
To/FromCODEGuides
Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

November Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyCorel Paradox / ObjectPAL Coding BoardParadox Reports Topic   Print This     

Calculated field and treat blank as zero

Calculated field and treat blank as zero in Paradox Reports topic (part of our Corel Paradox / ObjectPAL Coding group).

Quick Search: Calculated   Calculated field   Calculated field treat   blank zero  
OzPaul
Adelaide, South Australia

First I should mention that I have "treat blanks as zero" ticked in settings of Pdx10 running on Win7 at work. On my report  I have numeric fields which are covered by undefined calculated fields that show a text value of "Absent" when the corresponding numeric value is 0.0. Otherwise the numeric value is shown. The problem is that when the field is left blank, I want a calculated field to show "Not Done". When I set up an iif isBlank() condition in a calculated field, the calculation treats the blank field as a 0 and reports 0.0 rather than "Not Done". It is as if the treat blank as zero over-rides the isBlank() request.... This does not seem right to me because  the underlying table value certainly is blank... Can you help? Regards. Paul

Assume everything, Assume nothing!
 Posted 11 years ago (Thread Starter)
Comment Quote
About OzPaul
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #15137, 4 replies
Thread Started 5/1/2014 6:04:15 AM
View Counter=3492
Last Reply Posted 5/15/2014 11:16:58 PM)
Location=Adelaide, South Australia  
Joined=24 years ago   MB Posts=69   KB Comments=1  
Daniel Fought
Prestwood IT
Home office in Fresno, CA.

If you think about it this is correct behavior.  If you were attempting a simple calculation such as 100- you would want to "Treat blanks as 0".  Unfortunately, we cant have it both ways.

You may have to do something a little more arcane such has having an un-displayed  field attached to the field that has objectpal code to either assign the current table value to the unassigned field or if the field value is Blank then assign Not Done. 

Dan Fought
Senior Programmer Analyst
Prestwood IT Solutions
http://www.prestwood.com

 Posted 11 years ago
Comment Quote
About Daniel Fought
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Daniel Fought
Danial Fought is a senior programmer analyst with Prestwood IT where he develops custom Windows software and custom websites. When Dan is not coding for clients, he participates in this online community. Coding specialties include Paradox/ObjectPAL, MS Access, Visual Basic, and VS.Net/VB.Net.

Post ID #15138 (Level 2) and Parent is 15137
Reply Posted 5/1/2014 6:39:53 AM
Location=Home office in Fresno, CA. 
Joined=23 years ago   MB Posts=401   KB Posts=12   KB Comments=4  
OzPaul
Adelaide, South Australia

I have an unassigned field on the report which is defined as a calculated field and in the calculation references the (blank) table field via the alias and the field name... I would have thought that the reference to the table field with alias would return an isblank() = True rather than a zero.

Assume everything, Assume nothing!
 Posted 11 years ago (Thread Starter)
Comment Quote
About OzPaul
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #15139 (Level 3) and Parent is 15137
Reply Posted 5/7/2014 1:07:09 AM
Location=Adelaide, South Australia  
Joined=24 years ago   MB Posts=69   KB Comments=1  
Daniel Fought
Prestwood IT
Home office in Fresno, CA.

If you test the field object value you will find that isBlank() will work as you expect. 

iif(isBlank(YourFormObjectName),"This is Blank",[YourTableFieldValue])

Dan Fought
Senior Programmer Analyst
Prestwood IT Solutions
http://www.prestwood.com

 Posted 11 years ago
Comment Quote
About Daniel Fought
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Daniel Fought
Danial Fought is a senior programmer analyst with Prestwood IT where he develops custom Windows software and custom websites. When Dan is not coding for clients, he participates in this online community. Coding specialties include Paradox/ObjectPAL, MS Access, Visual Basic, and VS.Net/VB.Net.

Post ID #15140 (Level 4) and Parent is 15137
Reply Posted 5/7/2014 6:39:44 AM
Location=Home office in Fresno, CA. 
Joined=23 years ago   MB Posts=401   KB Posts=12   KB Comments=4  
Most Recent Post
OzPaul
Adelaide, South Australia

FYI, I have discovered that if I use the syntax fieldname = blank() rather than the isBlank() approach, then it works!

Assume everything, Assume nothing!
 Posted 11 years ago (Thread Starter)
Comment Quote
About OzPaul
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #15142 (Level 1.1)  Reply to 15140 and Parent is 15137
Thread Started 5/15/2014 11:16:58 PM
Location=Adelaide, South Australia  
Joined=24 years ago   MB Posts=69   KB Comments=1  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P176A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #15137 Counter
3492
Since 5/1/2014
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2025 Prestwood IT Solutions.   [Security & Privacy]