Redigerer
Mal:Infobox election/prepare prev results
(avsnitt)
Hopp til navigering
Hopp til søk
Advarsel:
Du er ikke innlogget. IP-adressen din vil bli vist offentlig om du redigerer. Hvis du
logger inn
eller
oppretter en konto
vil redigeringene dine tilskrives brukernavnet ditt, og du vil få flere andre fordeler.
Antispamsjekk.
Ikke
fyll inn dette feltet!
== {{langSwitch|ca=Descripció|en=Description}} == {{langSwitch|ca=El codi de càlcul de diferències amb l'edició anterior es trobava originalment a [[Plantilla:Infobox_election/prepare]].<br> És un codi amb diversos '''''if''''' imbricats amb "element" diferent a l'anterior en funció del cas. Per gestionar la nova característica sobre "'''partit equivalent'''" el codi es fa més complex i requereix diversos accessos addicionals a la base de dades.<br>Aquesta subfunció permet fer el càlcul a partir de diferents valors en funció de les circumstàncies. |en=The calculation code of differences with the previous edition were originally in Template:Infobox_election/prepare.<br> It's a code with several nested if's with different "item" as a previous in function of the case. To handle the new feature about "equivalent part" the code become more complex and required several extra access to database.<br>This sub-function allows to make the calculation from differents values in function of the circumstances. It is only used by}} [[Template:Infobox_election/prepare]] ---- <!-- DEBUG {{Infobox_election/prepare_prev_results |function =rate |type_election={{{type_election1|}}} |item_ant=Q113710176 |candidate=Q150398| P460equivalent= |candidate_look={{#if: {{{4|}}} |{{#invoke:Wikidades | claim | property= P726 or P991 |qualifier=P460 |colformat0=raw |colformat1=raw |formatting= table |list=false |item=Q113710176 |editicon=no |separator= |rowformat= $0 |whitelist0=Q150398 / |whitelist1=Q150398 / }} |Q150398}} }} --> </noinclude><!-- __________ function RATE _____________________________________________________________ It calculates the % of votes got by the party from the total votes * item_ant, points to previous item. It may be round 1,2 and it's determined by /prepara. * candidate_look is the Qid of party to look for. May contains the entity we are managing or the "equivalent party" ____________________________________________________________________________________ --> {{#ifeq:{{{function|}}}|rate |{{#ifeq:{{{type_election|}}}|limited-aggregate<!-- for limited-aggregate the rate is from P1410: number of seats/total seats --> |{{#iferror:{{#expr:100*{{#invoke:Wikidades | claim | property= P991 |qualifier=P1410 |colformat1=raw |formatting= table |list=false |editicon=no |item={{{item_ant|}}} |whitelist0={{{candidate_look|}}} | rowformat= $1 }} / {{{valid_votes|}}} round 2}}|0}}<!-- We may assume that total seats is the same between editions --> <!-- Code for type of election based in votes (all, left limited-aggregate --> |{{#iferror:{{#if:{{#statements:P1697|from={{{item_ant|}}}}}<!-- #valid votes in prev.elections --> |{{#expr:100*{{#invoke:Wikidades | claim | property= P726 or P991 |qualifier=P1111 |colformat1=raw |formatting= table |list=false |editicon=no |separator= |item={{{item_ant|}}} |whitelist0={{{candidate_look|}}} | rowformat= $1 }} /{{#invoke:Wikidades | claim | property= P1697 |item={{{item_ant|}}} |list= false |formatting=raw|editicon=no}} round 2}} }} }} }} }}<!-- --><!-- __________ function SEAT _____________________________________________________________ It calculates number of seats got by the party in previous edition * item_ant, points to previous item. It may be round 1,2 and it's determined by /prepara. * candidate_look is the Qid of party to look for. May contains the entity we are managing or the "equivalent party" ____________________________________________________________________________________ --> {{#ifeq:{{{function|}}}|seat |{{#if:{{{item_ant|}}} |{{#invoke:Wikidades| claim | property=P991 |whitelist0={{{candidate_look|}}} |qualifier=P1410 |colformat1=raw |formatting = table |list = false |editicon=no |item={{{item_ant|}}} | rowformat= $1}} }} }}
Redigeringsforklaring:
Merk at alle bidrag til Wikisida.no anses som frigitt under Creative Commons Navngivelse-IkkeKommersiell-DelPåSammeVilkår (se
Wikisida.no:Opphavsrett
for detaljer). Om du ikke vil at ditt materiale skal kunne redigeres og distribueres fritt må du ikke lagre det her.
Du lover oss også at du har skrevet teksten selv, eller kopiert den fra en kilde i offentlig eie eller en annen fri ressurs.
Ikke lagre opphavsrettsbeskyttet materiale uten tillatelse!
Avbryt
Redigeringshjelp
(åpnes i et nytt vindu)
Navigasjonsmeny
Personlige verktøy
Ikke logget inn
Brukerdiskusjon
Bidrag
Opprett konto
Logg inn
Navnerom
Mal
Diskusjon
norsk bokmål
Visninger
Les
Rediger kilde
Vis historikk
Mer
Søk
Navigasjon
Forside
Siste endringer
Tilfeldig side
Hjelp til MediaWiki
Spesialsider
Verktøy
Lenker hit
Relaterte endringer
Sideinformasjon
På andre prosjekter