NRCASES returns the number of cases (of a parameter) in an object, Telitab$ or solution

Syntax

NRCASES("ParAddress$")

Arguments

  • ParAddress$ is the address of a parameter. Also look at telitab access

Remarks

  1. NRCASES is a very convenient way to check whether and/or how many parameter are available in a data set. When you place the parameter address between quote, Quaestor will only use it to check the number of cases and will not introduce the parameter in the solution. This is very important because in this way you are able to check for values and objects without having to introduce them (and as a result be asked to the user, which you might not want to happen)
  2. Parameters, objects and object attribute names used in the NRCASES argument should exist in the knowledge base, if not, an error message is displayed.
  3. See examples for the use all kinds of option

Examples

1 Number of cases

Determining the number of instances of a parameter or object:

NRCASES("") returns the number of cases in the current solution

NRCASES("B") returns the number of cases of parameter B in the current solution. B can be a VALUE, STRING or OBJECT

NRCASES("*B") returns the number of matrix cases of parameter B in the current solution. B can only be a VALUE

NRCASES("PROP.") returns the number of cases in object PROP

If any string parameter is followed by "." or by ".Par" its value is assumed to contain a Telitab set for which the same applies as for objects:

NRCASES("Telitab$.") returns the number of cases in Telitab set being the current case value of Telitab$.

NRCASES("PROP.D") returns the number of cases of parameter D in object PROP

NRCASES("Telitab$.Par") returns the number of cases of parameter Par in Telitab set being the current case value of Telitab$.

NRCASES("PROP.*D)") returns the number of matrix cases of parameter D in object PROP

NRCASES("Telitab$.*Par)") returns the number of matrix cases of parameter Par in Telitab set being the current case value of Telitab$.

Remarks

  1. With matrix cases we mean the number of different cases in the table. For instance, if you have a 3D space description, for each x value you have a table of y,z values. If you put this in a data set, you get columns of x, y and z values like this:
      

    0
       3    "x" "y" "z"
       "1"  1    1   1
       "2"  1    1   2
       "3"  1    2   2
       "4"  2    1   1
       "5"  2    1   2
       "6"  2    2   2
       "7"  3    1   1
       "8"  3    1   2 
       "9"  3    2   2 

    If you ask for the number of matrix cases of x, you get 3 (and not 9), because there are 3 x-coordinates

  2. Nested parameter addresses like "PROP$.OWDAT.KT" and "PROP$.OWDAT$.KT" are allowed
  3. Telitab$ attribute names used in the NRCASES argument do not need to exist in the knowledge base. If they don't exist in Telitab$, zero is returned as NRCASES.

2 Finding instance or case number of value

Next to determining the number of instances of a parameter or object, it is possible to determine the case/instance number of a parameter with a particular value:

NRCASES("ID$=MainDiesel.2") returns the case number of ID$ with value "MainDiesel.2" in the current solution. Please note, this is case sensitive

NRCASES("Components.ID$=MainDiesel.2") returns the first case number of ID$ in object/Telitab$ Components with value "MainDiesel.2"

NRCASES("Components.ID$=@MAINDIESEL.2") returns the first case number of ID$ in object/Telitab$ Components with value "MainDiesel.2", prefix "@" stands for equal

NRCASES("Components.ID$=&DIESEL") returns the first case number of ID$ in object/Telitab$ Components contains the word "DIESEL", prefix "&" stands for contains

NRCASES("Components.Q=40.8") returns the first case number of which the value of Q in object/Telitab$ Components equals 40.8, the rounded values (as presented in the workbase) are compared, no prefix possible


 

Quick links: Functions overview | Attribute overview | Constants overview | Dimensions overview


  • No labels