Forum Discussion
gauravnarchal
5 years agoPost Prodigy
Calculated column
Hello All I need your help in creating the calculated column as below. If Table 1 Product Code = Table 2 Product code and Table 1 product type 16 = “1” in (table 3 city type) then Match...
ryan_mayu
5 years agoSuper User
not clear about this. Could you please separate the table in different rows? It's hard to understand how many columns in each table
- gauravnarchal5 years agoPost Prodigy
ryan_mayu - Here is how the data look like in the separate tables.
Thank you
Table 1
Product Code Product Type 0 10 1 11 2 12 3 16 Table 2
Product Code City Code 0 AAC 1 AAE 2 AAE 3 GLE Table 3
City Type City Country 0 AAC AFRICA 0 AAE AFRICA 1 AAE MALDIVES 1 AAI MALDIVES - Ashish_Mathur5 years agoSuper User
Hi,
In which Table do you want to see that calculated column? In that table, show the expected result.
- ryan_mayu5 years agoSuper User
which column is the expected result?
- gauravnarchal5 years agoPost Prodigy
Hi ryan_mayu Please see below.
If Table 1 Product Code = Table 2 Product code
and
Table 1 product type 16 = “1” in (table 3 city type)
then
Match
Table 2 city code with Table 3 city code and return table 3 country
Else return the country from “0” in (table 3 city type)
For any errors or mismatches return the value as “Mismatch”
DATA
Table 1 Product Code Product Type 0 10 1 11 2 12 3 16 Table 2 Product Code City Code 0 AAC 1 AAE 2 AAE 3 GLE 5 AMR 0 28JU 0 JKLW 0 "2JK Table 3 City Type City Country 0 AAC AFRICA 0 AAE AFRICA 1 AAE MALDIVES 1 AAI MALDIVES 0 GLE INDONESIA 1 GLE BHUTAN RESULT
Table 2 Product Code City Code Country 0 AAC AFRICA 1 AAE AFRICA 2 AAE AFRICA 3 GLE BHUTAN 5 AMR MISMATCH 0 28JU MISMATCH 0 JKLW MISMATCH 0 "2JK MISMATCH