Use as mask question

DataGraph Forums Technical Support Support Desk Use as mask question

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2987
    c goncalves da silva
    Participant

      Hello

      As far as I understand, “Use as mask” with several options is limited to a global “and” or a global “or”. Is it possible to combine “and” and “or”? This is feature I would dearly like to have.

      Thanks

      C Goncalves da Silva

      #2990
      dgteam
      Moderator

        By including commands in nested groups, you can combine the ‘and’ or global ‘or’. Here is an example:

        Say you want to plot this data …

        Mask1

        Including all the data in a Points command and Fit command would look like this:

        Mask1B

         

        Say you need to limit by the Category column, so that you only have A or B.

        You can place both commands in a group (highlight the commands and hit the group icon in the toolbar Or create the group and drag the commands).

        And add a Shared Mask to include ‘A’ or ‘B’.

        Mask1C

        Say you also want to remove the points where ‘x = 0’.  It is impossible to add to the current shared mask, as that is only for ‘Or’ statements.

        Instead, nest the group inside another group… and add a mask at the top level.

        Mask2

         

        You can nest as many groups as you need.

        Will this solve what you want to do?

         

        #2991
        c goncalves da silva
        Participant

          Hello

          Thank you for your detailed answer. I will see how I can adapt it for my problem. Maybe, in a future version, you could make the “use as mask” command more flexible?

          Thanks and regards

          C Goncalves da Silva

          #2992
          dgteam
          Moderator

            If you prefer to stick with the  ‘use as mask’ within the command, you can also write logical statements.  This gives you a lot of flexibility.

            Step 1 – Set the Use as mask to the column you want to base the criteria

            Step 2 – Set Include if value to ‘Logical’.

            Step 3 – Enter a logical statement in the criteria box, using ‘v’ to represent the column you selected in Step 1.

            By default the criteria box is set to “v!=0”,  meaning that the rows are included only when the column selected in step 1 is not equal to zero.

            For the example, here is how to set the criteria using Logical statements:

            Mask3

             

            You could also combine ‘And’ statements with ‘Or’ statements like this …

            Mask4

            where this is the same as:

            (x >1 AND x<8) AND (Category=1 OR Category=2)

            You can use the same mathematical operators as in expression columns.

            NOTE: Logicals only work with numeric variables, so if you have a text column you have to map it to a number value, which can be done in the definition of the text column.

            Hope this helps!

             

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.

          DataGraph Forums Technical Support Support Desk Use as mask question