Decimal Variable

-matrix--matrix- Member Posts: 103
Hi Everybody !

In a report i need to assign blank value (not default value zero)to decimal variable when some condition occur.
Is it Possible this?

Thanks in Advance

Comments

  • MBergerMBerger Member Posts: 413
    There are no NULL values in NAV, so if you want to signify that a decimal is undefined rather than 0, you'll have to do that with an extra boolean or something similar.
  • vaprogvaprog Member Posts: 1,139
    Use a text variable in the control into which you FORMAT your decimal or clear it before.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Why do you need all this when you can use the existing property called BlankZero?
  • MBergerMBerger Member Posts: 413
    Why do you need all this when you can use the existing property called BlankZero?
    ZERO != NULL. Undefined has a completely different meaning than 0. 0 has a significance, Null means you don't know or that something is not applicable.
  • matttraxmatttrax Member Posts: 2,309
    As stated above, there is no NULL value for anything. You can do a work around in this case, though. You can start with a blank or empty string which will represent your NULL value. You can then assign that string a formatted value, like FORMAT(Your Number) so that you know it actually received a value. If it is blank, then it is still "NULL". If you need to convert that string back to a number you can use EVALUATE.

    You can even make an IsNull function that takes in a string and returns true if it is blank (NULL) so that you can understand your code better.

    A boolean that holds whether or not the number has been assigned to work as well, though.
  • SavatageSavatage Member Posts: 7,142
    The orig poster needs to clarify what he means by "blank value".

    if the goal is just not to show 0 value decimals in a report or form then "BlankZero" is an easy solution.

    if the goal is a "blank value", a decimal can't have a blank value and you will have format over to a text type.
  • -matrix--matrix- Member Posts: 103
    Thanks To everybody! But I Solved Using a visibility condition on the report fields with value 0 :)
  • SLF25SLF25 Member Posts: 37
    Don't reinvent the wheel, do like mohana_cse06 suggested.
  • SavatageSavatage Member Posts: 7,142
    Exactly. Just click the field in question. View the properties. Set BlankZero to YES.
  • vaprogvaprog Member Posts: 1,139
    Why do you need all this when you can use the existing property called BlankZero?
    Because the original query was
    -matrix- wrote:
    ... when some condition occur.
    which is more general than "when it is 0".
    We all assumed, though, that by
    -matrix- wrote:
    i need to assign blank value
    -matrix- ment to show a blank space instead of some number.
  • DenSterDenSter Member Posts: 8,305
    vaprog wrote:
    -matrix- ment to show a blank space instead of some number.
    Not 'some number' but 'not default number zero', so therefore BlankZero was the right choice all along. Mohana was the only person that actually understood what the OP was asking for.
  • vaprogvaprog Member Posts: 1,139
    I still disagree.

    -matrix- said that he wants to assign a certain value to a decimal, given a certain condition is met. That assigned value should be blank and should not be zero. He does not say anything about the case when this condition is not met. So we must assume the decimal can have any decimal value then, including zero. If we use BlankZero, even those will not print, even though the condition is not met.

    A common application of this scenario is showing a percental change. If no change happened, the value is 0 %. If the value you define to be the base (100%) is 0, your result is undefined. So you should show some sensible indication for this condition. I believe showing a blank in this situation is a well choice, but showing blank for no change is not that good.
  • DenSterDenSter Member Posts: 8,305
    @vaprog: You are reading too much into Matrix's first post. Their English might not be as good as yours, they probably never meant as much as you seem to read into the question. Look at the first post, then look at Matrix's reaction to later posts. Try to see what they wanted to ask, and see which reply answered the question for them.

    You are insisting on the full meaning of the correctness within the words that were posted, and you do not seem to want to try to understand what the OP wanted, which clearly was not as elaborate as what you are talking about. This is not a theoretical discussion about what might or might not be meant when using certain words in a certain context. The OP asked a question, and the BlankZero property was clearly what they wanted to know about. It doesn't matter what other meaning their words might have. The original question was understood and answered by Mohana, there simply was no further meaning in the OP.

    You can disagree all you want, and technically there's merit to what you are saying, but in this case you are always going to be wrong :mrgreen:
  • maya-chanmaya-chan Member Posts: 45
    I found this forum, and sound interesting which indicate have similar prob with me.
    For me, I need to not show the 0 if it doesn't have anything follow/related.

    For example :

    Part No Description QTY Unit UnitPrice Total
    P001 Coverhead 2 PCS 0 0
    PO#C00123 0 0
    1 Months 0 0

    The zero (0) on 2nd and 3rd line will dissapear, but on 1st line still show there. How I make it?
    Anyone can help me?
    Thx
Sign In or Register to comment.