Module talk:Wd/Archive 1: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Wd) (bot
m Archiving 1 discussion(s) from Module talk:Wd) (bot
Line 1,552:
:::@[[User:Sdkb|Sdkb]]: glad it worked (wasnt' sure what exactly wasn't working). I don't think the ''blank equals sign'' will cause any problems; when there's nothing on its left, it should be discarded. If, however, you want to run some tests on your variables, you can try <syntaxhighlight lang="wikitext">{{#if:…{{{qualifier|}}}…| {{Wikidata|…|{{{qualifier}}}={{{qualifier-value}}}}} | {{Wikidata|…}} }}</syntaxhighlight> Someone more familiar with parsers and stuff might tell us if there's a better way; something tells me there has to be a hard-coded = sign, and not its replacements. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 20:23, 10 April 2024 (UTC)
:::The same test, using the nothing-on-the-left-of-equals-sign trick: <syntaxhighlight lang="wikitext">{{Wikidata |qualifier |single |{{{property|}}} |P585 |eid={{{entity|}}} |{{#if: some function of {{{qualifier|}}} and {{{qualifier-value}}} | {{{qualifier}}} | }} = {{{qualifier-value}}} }}</syntaxhighlight> [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 20:30, 10 April 2024 (UTC)
 
== Current population value ==
 
[[:Wikidata:Q6045892]] page contains population values between 2007-2022. However, when I type the [[:wikidata:Property:P1082]] value, the template calls the population value for 2007. What should I do to have it call up the population value for the most recent year?
:<code><nowiki>{{wd|property|Q6045892|P1082}}</nowiki></code> → {{wd|property|Q6045892|P1082}}
Thank you. [[User:Sadrettin|Sadrettin]] ([[User talk:Sadrettin|talk]]) 10:48, 7 April 2024 (UTC)
 
:You have at least two options, @[[User:Sadrettin|Sadrettin]]:
:* <nowiki>{{wd|property|Q6045892|P1082|P585=2022}}</nowiki> >> {{wd|property|Q6045892|P1082|P585=2022}}
:* Change the rank of the latest property on wikidata to preferred
:[[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 13:08, 7 April 2024 (UTC)
 
:<syntaxhighlight lang="wikitext">
{{#invoke:wd
|property
|P1082
|P585={{#invoke:Wikidata
|getRawQualifier
|qualifier=P585
|property=P1082
|sort=P585
|invert=true
|limit=1
}}
}}
</syntaxhighlight>
:The above filters the multiple values of population (P1082 property) by the latest year (P585 qualifiers). If you add <code>|P459=Q6042918</code> after <code>|P1082</code>, then the result is also filtered by determination method. [[User:Serresmap|Serresmap]] ([[User talk:Serresmap|talk]]) 18:55, 18 April 2024 (UTC)
::{{ping|Serresmap}} Thank you for your reply. When I wrote this code exactly, it didn't work. Could there be a problem? Could you please check again? --[[User:Sadrettin|Sadrettin]] ([[User talk:Sadrettin|talk]]) 08:41, 23 April 2024 (UTC)