Forum Discussion

WDW's avatar
WDW
New Member
5 years ago
Solved

Iterate through values to create a new column based on lookup from another table

I have a table named ChanData with 3 columns: timestamp, ChanID, Value. The data in the value column is the metric (si) value for the associated ChanID I have a second table named ConvFactor that has...
  • lbendlin's avatar
    5 years ago

    Let the data model do the work for you. What are your tables linked on?  Is the correction factor per channel ID stored somewhere?

     

    You can simplify your switch() statement like this:

     

    Imperial = SWITCH(

    [ChanID],106, [Value] * RELATED(ConvFactor[Conv])+(32),

    [Value] * RELATED(ConvFactor[Conv])

    )