在 Tableau 中加入和标准化来自不同来源的国家/地区名称

问题描述 投票:0回答:1

我正在计算一些指标,需要标准化各个方面的国家/地区名称,以便在国家/地区级别进行计算。

我有一个事务文件,由两个 SQL 查询和外部 Excel 文件组成。
国家/地区 1 列 - 第一个 SQL
国家/地区 2 列 - 第二条 SQL
国家/地区组合列 - 计算字段
国家 Excel 列 - Excel 列

国家合并的制作者:

    IF [data (TI)] = [data (PI)] THEN
    [hotel_country (TI)]  // or [hotel_country (PI)] since they are the same
ELSEIF NOT ISNULL([data (TI)]) THEN
    [hotel_country (TI)]
ELSE
    [hotel_country (PI)]
END

我需要做的是将国家/地区组合与国家/地区 Excel 列相匹配,以便进行国家/地区级别计算。
enter image description here

join calculated-columns tableau-desktop
1个回答
0
投票

在这种情况下,您可能正在寻找包含函数

类似:

IF CONTAINS([country combined], [country excel]) //if country excel is in country combined, return true
THEN [country combined] //whatever field you want returned if your above condition is met.
END
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.