Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Null value Post Reply Post New Topic
Author Message
jlindquist23
Newbie
Newbie
Avatar

Joined: 06 Jun 2019
Location: United States
Online Status: Offline
Posts: 5
Quote jlindquist23 Replybullet Topic: Null value
    Posted: 30 Nov 2023 at 7:31am
I have some basic formulas I use for reporting that don't seem to work for all.

The two fields below can have null values in them. The default is null, if checked, value is "Y", if checked and then unchecked, the value is "N":
{CI_Item.UDF_PK_ORDERBYKIT}
{CI_Item.UDF_PK_ORDERBYSWK}

I'm doing a very simple calculation for ORDER TOTAL:
if {CI_Item.UDF_PK_ORDERBYSWK} = "Y" then ({SO_SalesOrderDetail.QuantityOrdered} - {SO_SalesOrderDetail.QuantityShipped})*{CI_Item.UDF_PK_QTYPERSHRINK}
else if {CI_Item.UDF_PK_ORDERBYKIT} = "Y" then ({SO_SalesOrderDetail.QuantityOrdered} - {SO_SalesOrderDetail.QuantityShipped})*{CI_Item.UDF_QTYPERBOX}
else ({SO_SalesOrderDetail.QuantityOrdered} - {SO_SalesOrderDetail.QuantityShipped})

Most of the items in my report will work, but will make any new items ORDER TOTAL = 0

if also created null value type formulas to force the N and Y and substitute them into the above formulas and have the same result. I've used this in reports over and over and have no idea why this doesn't work here.

My null value type formulas look like this:
OrderByBoxIsNull:
if isnull({CI_Item.UDF_PK_ORDERBYKIT}) then "N"
else If {CI_Item.UDF_PK_ORDERBYKIT} = "N" then "N"
else "Y"

OrderBySWKIsNull:
if isnull({CI_Item.UDF_PK_ORDERBYSWK}) then "N"
else If {CI_Item.UDF_PK_ORDERBYSWK} = "N" then "N"
else "Y"

When I put these fields in the report they show up correctly on 90% of the items, but the rest show 0.

What am I missing? Thanks for the help!
I have limited knowledge of what the Exceptions for Nulls selection does. Currently, that is what is selected in the formula editor.
Thanks,
Jennifer
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.020 seconds.