0

Is it possible to display a Quantity in multiple units at the same time in #ask query.

Say I have a property [[Has length]]

[[Has type::Quantity]]
[[Display units::in,cm]]
[[Corresponds to::1 in]]
[[Corresponds to::2.54 cm]]

And then I have a query like

{{#ask: [Category:Cables]
|?Has length
|format=table
}}

I like to be able to display the length in 'in' and 'cm' say something like

Cable A | 12 in (30 cm)
Cable B | 6 in (15 cm)

I tried |?Has length#in (cm) but that didn't work

Adrian Cornish
  • 23,227
  • 13
  • 61
  • 77

1 Answers1

1
{{#ask: [[Category:Cables]]
|?Has length#in
|?Has length#cm
|format=table
}}

A similar example (length in meters and kilometers): https://traditio.wiki/Project:Test80.

Note the double brackets.

If you want to display different units of measurement in the same column, you have to use format=template and a corresponfing template like

{{!}}-
{{!}} {{{2|}}} ({{{3|}}})
Alexander Mashin
  • 3,892
  • 1
  • 9
  • 15
  • Ah typo on the selection criteria - I didn't know you could use a template that looks like just what I want - I shall read docs. Thanks – Adrian Cornish Nov 03 '20 at 16:15