The result of LAYOUT_NR in the design view is only a placeholder.

To see the actual result of LAYOUT_NR you will either need to print or open the print preview. The reason for this is that PSM needs to know which layouts are skipped and which layouts are printed before it can evaluate LAYOUT_NR. PSM does not have access to this information in the design view.

LAYOUT_NR does not return a constant index. It returns a counter that is incremented every time a layout is printed. Skipped layouts are not counted, and it resets after every record. Taking Raphael's test as an example:

Record 1:
Layout 1 is printed. The LAYOUT_NR counter is incremented, its value is 1.
Layout 2 is skipped.

Record 2:
The LAYOUT_NR counter resets to 0.
Layout 1 is skipped.
Layout 2 is printed. The LAYOUT_NR counter is incremented, its value is 1.

The result of LAYOUT_NR will be 1 for both records.

Future versions of PSM will no longer allow you to use LAYOUT_NR in the scope of a layout condition. The LAYOUT_NR counter will only be valid after the current layout condition has been evaluated. If the current layout condition makes use of LAYOUT_NR, there's a circular reference.