English Français Deutsch

Relation Election 6

Allocate seats on a fictional national level

read "ef2019.csv"
select partei !== "Übrige"
project partei, fiktive_waehlende sum
relation number
set i = 0
while i < 60
set i = i+ 1
insert i
end while
write "numberlist.csv"
join cross
extend quotient = fiktive_waehlende_sum/number
order quotient 9
limit 1 200
print 10
project partei, number count
order number_count 9
write "seats2019national.csv"
print

partei fiktive_waehlende_sum number quotient
SVP 620349.899000000092 1 620349.899000000092
SP 408134.044999999809 1 408134.044999999809
FDP 358078.654999999912 1 358078.654999999912
GPS 319996.956999999937 1 319996.956999999937
SVP 620349.899000000092 2 310174.949500000046
CVP 275854.993000000017 1 275854.993000000017
SVP 620349.899000000092 3 206783.299666666688
SP 408134.044999999809 2 204067.022499999905
GLP 189162.470999999961 1 189162.470999999961
FDP 358078.654999999912 2 179039.327499999956
partei number_count
SVP 53
SP 35
FDP 31
GPS 27
CVP 24
GLP 16
BDP 5
EVP 4
PdA/Sol. 2
EDU 2
Lega 1