【问题标题】:Set Analysis comparing two fields比较两个字段的集分析
【发布时间】:2016-10-06 19:45:42
【问题描述】:

我已使用余额日期和兑换率有效时的 MatchInterval 将期末余额列表与一组货币汇率联系起来。我在两个字段中都有多种货币,因此希望在两种货币匹配并应用正确的汇率时返回。

sum( {$ <BalanceAutoNumber={"=BalanceCurrency=Currency"}>} ClosingBalance*CADMultiply) 

根据在线指南,我已将 BalanceAutoNumber 字段添加到余额表中,作为我要选择的维度。但是,我只有在两个字段中手动选择时才会得到结果。

我可以通过下面的 IF 语句来实现这一点

sum(if(CompanyCurrency=Currency,ClosingBalance*CADMultiply,0))

【问题讨论】:

    标签: qlikview qliksense


    【解决方案1】:

    作为临时解决方案,我已经修改了我的数据模型,以便数据之间的间隔匹配链接强制这种关系。

    CurrencyIntervalMatchRaw:
    IntervalMatch(DateForCurrencyRates)
    Load distinct StartDateTime, EndDateTime
    Resident CurrencyRates;
    
    join(CurrencyIntervalMatchRaw)
    Load Distinct Currency
    Resident CurrencyRates;
    
    
    CurrencyIntervalMatch:
    Load date(DateForCurrencyRates,'YYYYMMDD')&'_'&Currency as %Join_CurrencyRates,
        Currency,
        StartDateTime,
        EndDateTime
    Resident CurrencyIntervalMatchRaw;
    
    Drop Table CurrencyIntervalMatchRaw;
    Drop Field DateForCurrencyRates From Balances;
    

    有了这个修改后的模型,我不需要集合分析来限制显示的数据。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-21
      • 2021-12-11
      • 1970-01-01
      • 1970-01-01
      • 2021-12-18
      • 2018-12-03
      • 2011-10-30
      • 2023-03-05
      相关资源
      最近更新 更多