0

Is it possible to combine two properties with the same datatype into one column in an #ask query in SMW?

Suppose I have different datasets with Identifiers that are named differently:

#Object1
[[Has isbn::9780552145985]]

#Object2
[[Has id=83897239]]

I would like to combine these two in one column in an #ask query, like this:

{{#ask:
 [[Category:Besitz]]
 |?Has id = ID
 |?Has ISBN = ID
 |format=broadtable
}}

In the result I would like to have only the one column ID instead of two columns that are called ID.

Thank you in advance!

Wald3n
  • 133
  • 1
  • 10

1 Answers1

1

Use template format instead of broadtable with template like

{{!}}-
{{!}} {{{Has isbn|{{{Has id|}}}}}}

Or install Semantic Scribunto, use mw.smw.ask and row['Has id'] or row['Has isbn'].

Alexander Mashin
  • 3,892
  • 1
  • 9
  • 15
  • Thank you for the answer! I am not yet very firm with the templates for SMW output tables, so I had to change it to something like: {{{2|}}} {{{3|}}} But that way it works well for my purposes. – Wald3n Oct 18 '20 at 15:19