Look-up Item Types – 64, 65 and 56

 

Dairy Comp has three look-up item types, which behave similar to a LOOKUP function in a spreadsheet:

64 :  converts a range of integers into an index

65 :  converts an index into a string

56 :  converts a string into an index.

 

Item type 64 is a table lookup, that returns an index based on the value of a different item.

 

A common example is a DIM table to create a stage of lactation.

   DIM Range   PHASE

           0       0

       1-100       1

     101-200       2

     201-300       3

    Over 300       4

The item PHASE can be calculated from DIM using the type 64.  In ALTER\Items\Add an item definition:

Name        : PHASE

Item Type   : 64   Lookup Table

Item Name   : DIM

Which Table : 1    (Eight lookup tables are possible)

Next, table 1 need to be defined - the cutoff values:

         DIM   Value

   0       0       0

   1     100       1

   2     200       2

   3     300       3

   4    9999       4

 

SHOW ID DIM PHASE will verify the correct creation.

 

 

Item type 65 provides a word description for a numeric item.

 

Sometimes numbers are clearer as words.  An example might be pen numbers and names.

   Pen     Name

     0     HEIFERS

     1     FRESH

     2     HIGH

     3     MID

     4     LOW

     5     DRY

The item PNAME can be calculated from DIM using the type 65.  In ALTER\Items\Add an item definition 

        Name        : PNAME

        Item Type   : 65   Description Table

        Item Name   : PEN

        Which Table : 1    (Four description tables are possible)

Next, table 1 need to be defined - the names:

   PEN     Value

   0       HEIFERS

   1       FRESH

   2       HIGH

   3       MID

   4       LOW

   5       DRY

 

SHOW ID PEN PNAME will again verify the correct creation.

 

 

Item type 56 provides an index based on the contents of a string.

 

Suppose an open diagnosis results in one of three options:  LUT, GNRH, or GNRHIN7

We then might wish to set the next breeding date to 3, 10, or 17 days.

 

The item NXTBR can be calculated from REM using the type 56.  In ALTER\Items\Add an item definition 

        Name        : NXTBR

        Item Type   : 56   Lookup Table

        Item Name   : REM

        Which Table : 2    (Four description tables are possible)

Next, table 2 need to be defined - the names:

   REM     Value

   IN7     17

   GNRH    10

   LUT     3

 

 

SHOW ID REM NXTBR will again verify the correct creation.

 

A more practical example might be for setting SYDAT after a vet check

Define table 2 as follows:

   REM     Value

   IN7     21

   GNRH    28

   LUT     35

 

ENTER SYDAT=TODAY-NXTBR FOR VDAT=TODAY PVET=3 RC=3

 

 

Notes on item type 56:

1.                  Version must be Dec. 2004 or newer for it to work.


2.         The item has 4 possible tables.  Those 4 tables are the same ones used by type 65 items.  If all 4 tables are used by item type 65s, you must delete

an item type 65 first, then setup the table for the new item type 56.  Otherwise, the table ends up as a combination of both items so neither one looks or works right.