Metadata from TWO separated files should go in ONE row of the table

What I’m trying to do

The idea is very simple, but i’m not able to solve it in an elegant way.
I have to files containing metadata:

#Device

DUT: A1 Width: 0.01

#Device

I want to make a query which drags the information about Resistance, Current and Width per DUT. The Current and Width should be multiplied by 1000 to get this Table:

DUT Resistance(Ohm) Current(A) Width(m)
A1 100 1 10

Things I have tried

``````TABLE WITHOUT ID
DUT,
join(rows.Current) AS Current(A),
join(rows.Resistance) AS Resistance(Ohm),
join(rows.Width) AS Width(nm)
FROM
#Device
GROUP BY DUT AS DUT
``````

Problem 1 with that approach:

This already gives me kind of what i want, but not beautiful.
The dataviewer finds every DUT twice:

DUT Resistance(Ohm) Current(A) Width(nm)
A1 - - 10
A1 100 1 -

The grouping and join() gives you
DUT Resistance(Ohm) Current(A) Width(nm)
A1 -,100 -,1 10,-

Problem 2 with that approach:

I have to multiply the values with 1000 to have the numbers how i need them.
I cannot multiply any more when i use e.g. rows.Current.

I hope somebody knows an reasy solution for that problem.

I’m on mobile, so can’t type out the full example, but try doing `nonnull(rows.Ohm)[0]` to single out the first non null value for resistance, and similar for the other values.

1 Like

Thank you so much, holroy. This solves both problems.
Getting rid of the “-” and the multiplication error.
Here’s the workable code:

``````TABLE WITHOUT ID
DUT,
nonnull(rows.Current)[0] * 1000 AS Current(A),
nonnull(rows.Resistance)[0] AS Resistance(Ohm),
nonnull(rows.Width)[0] *1000 AS Width(nm)
FROM
#Device
GROUP BY DUT AS DUT
``````
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.