Forum Discussion

julia-wzl85d's avatar
julia-wzl85d
New Member
5 years ago
Solved

How to create a calculated column based on two other columns

 

Hello, 

I have a database that has a customer's request number (ex: 98329 - wardrobe) and one more column with hierarchy codes (1- Send raw material 2- Product Manufacturing 3- Send to customer 4- Assembly of product). I want to make a column only with the smallest number that appears in the hierarchy, for example:
 

Request number                       Code                First Code

 

Nº 9485 -Wardrobe                     3                           2 

 

Nº 9485 -Wardrobe                     2                           

 

Nº 9485 -Wardrobe                     4                           


-----------------------

Nº 9481 - TV Panel                      3                          1 

 

Nº 9481 - TV Panel                      2                          

 

Nº 9481 -TV Panel                       1                          1        

 

Any ideias how to create that column?
  • julia-wzl85d Sure:

    First Code Column = 
      VAR __RequestNumber = [Request number]
    RETURN
      MINX(FILTER('Table',[Request number] = __RequestNumber),[Code])

2 Replies