Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: mmarinelliYou'll need to employ an Agg to calculate the total, and then match that total to the original data in order to calculate the percentage. The code below provides an example of this technique.
--
node:Agg
bretype:core::Agg
editor:sortkey=4a2fdfc05d864ade
input:@40fd2c7427456e5b/=Static_Data.40fe6c55598828e5
output:@40fd2c744c862db0/=
prop:GroupBy=<<EOX
1
EOX
prop:Script=<<EOX
TOT = sum(CNT)
emit *, TOT
where lastInGroup
EOX
editor:XY=140,110
end:Agg
node:Lookup
bretype:core::Lookup
editor:sortkey=4a2fe03868b97532
input:@40fd2c746abc6dc7/=Static_Data.40fe6c55598828e5
input:@40fd2c74486e4494/=Agg.40fd2c744c862db0
output:@40fd2c7445835585/=
prop:InputKey=<<EOX
1
EOX
prop:LookupKey=<<EOX
1
EOX
prop:Script=<<EOX
emit 1:*
emit (1:CNT / 2:TOT) * 100 as PCT
exclude referencedFields(2,{{^LookupKey^}})
EOX
editor:XY=220,60
end:Lookup
node:Static_Data
bretype:core::Static Data
editor:sortkey=40
end:Static_Data