2016-10-05 1 views
0

나는 잔고의 날짜와 환율이 유효한 때의 MatchInterval을 사용하여 닫는 잔액리스트를 환율 세트에 연결했습니다. 두 필드에 여러 통화가 있으므로 두 통화가 일치하고 올바른 환율을 적용 할 때 돌아가고 싶습니다.두 필드를 비교 한 세트 분석

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

은 온라인 가이드 당, 나는에 선택하는 내 차원으로 잔액 테이블에 필드 BalanceAutoNumber을 추가했습니다. 그러나 두 필드에서 수동으로 선택할 때만 결과를 얻습니다.

내가 임시 해결책으로

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

답변

0

다음과 같이 IF 문에 이것을 달성 할 수있는, 내 데이터 모델을 수정 한 데이터의 힘 사이의 간격이 일치하는 링크가이 관계 있도록.

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; 

이 수정 된 모델에서는 표시된 데이터를 제한하기 위해 분석을 설정할 필요가 없습니다.