AVEVA. PML BASICS. Subtotal

images
Here is small example how works subtotaling in AVEVA PDMS:

–New array with cars
!cars[1] = ‘Lambo
!cars[2] = ‘Bugatti
!cars[3] = ‘Bugatti
!cars[4] = ‘Porche

— Sorting cars array
var !carsInd sort !cars lastingroup !group

— New array with number of this cars
!qua[1] = ’12’    $* Lambo
!qua[2] = ‘1’     $* Bugatti
!qua[3] = ‘1’     $* Bugatti
!qua[4] = ’66’  $* Porche

— Values in indexed car array
q var !carsind

[1] <STRING> ‘2’     –>>>  Bugatti
[2] <STRING> ‘3’     –>>>  Bugatti
[3] <STRING> ‘1’
[4] <STRING> ‘4’

— Values in grouped array
q var !group
<ARRAY>
[2] <STRING> ‘1’   –>>>  Bugatti +  Bugatti
[3] <STRING> ‘2’
[4] <STRING> ‘3’
— Subtotaling the number of each car
var !pieces subtotal !qua !carsind !group

— Number of each car
q var !pieces
<ARRAY>
[2] <STRING> ‘2’     $* Here is quantity of Bugatti
[3] <STRING> ’12’   $* Here is quantity of Lambo
[4] <STRING> ’66’  $* Here is quantity of Porche

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s