Denoting missing values in expressions

tennenrishin
tennenrishin New Altair Community Member
edited November 5 in Community Q&A
Hi everyone.

Please bear with me if this has been asked before.

Is there a symbol or identifier that can be used to denote "missing value" in an expression.
For example, I am using the "Generate Attributes" operator, and I want the generated attribute to be missing under some conditions. For example:
if(Denominator==0,missing_value,other_expression)

I have tried "Missing", "MissingValue", "NaN", "Double.NaN' but these don't work, so I end up having to reserve a value and then follow up with the "Declare Missing" operator.

Thanks in advance
Isak
Tagged:

Answers

  • Andrew2
    Andrew2 New Altair Community Member
    Hello Isak,

    Use the "Declare Missing Value" operator (under data transformation -> value modification).

    regards

    Andrew
  • tennenrishin
    tennenrishin New Altair Community Member
    Thanks Andrew.
  • land
    land New Altair Community Member
    Hi,
    for numerical attributes you can enter an invalid calculation so for example 0/0.

    Greetings,
      Sebastian
  • tennenrishin
    tennenrishin New Altair Community Member
    Thanks Sebastian!
  • dragoljub
    dragoljub New Altair Community Member
    This has been giving me problems too.

    In my case I want to use filter examples (on a special attribute) with the attribute value filter. I cant seem to enter "?" in any way to select only examples where att1=?

    How can this be done?  ???

    The way I get around it is change my attribute role to regular then filter missing attributes and then change back the role to special. This only works in my case since I only have one column with missing attributes.

    There should be a missing value macro for use in filter expressions!  ;D

    Thanks,
    -Gagi
  • land
    land New Altair Community Member
    Hi Gagi,

    actually this problem is detailed described in the help window: Missing values for numerical attributes are encoded by ?, for nominal by \?.

    Anyway the filter examples operator is on top of our todo list for enhancements. It's quite ugly compared to the attribute selection...

    Greetings,
      Sebastian
  • dragoljub
    dragoljub New Altair Community Member
    Great thanks Sebastian,

    Updating the filter operator would be of great help. Especially for filtering on multiple attribute values, similar to the newer list view in set role.  :)

    Thanks,
    -Gagi
  • dragoljub
    dragoljub New Altair Community Member
    In my case, to use the solve my problem I had to use double quotes around the macro and the "?".

    This seemed to work: if("%{macro}"=="?",1,2)

    I guess I just assumed the macro would be treated as a character, but now I understand it just replaces the sring and makes no assumptions about type.

    Hope this helps someone.  ;D
    -Gagi
    Sebastian Land wrote:

    Hi Gagi,

    actually this problem is detailed described in the help window: Missing values for numerical attributes are encoded by ?, for nominal by \?.

    Anyway the filter examples operator is on top of our todo list for enhancements. It's quite ugly compared to the attribute selection...

    Greetings,
      Sebastian