2014-10-31 174 views
2

請注意,雖然這個問題是一個完全不同的問題,它直接關係到this question.case語句

以下是返回的數據集爲我的SSRS圖表的腳本:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" aggregate="true"> 
     <entity name="account"> 
     <attribute name="bio_employeesworldwide" alias="TotalWorldWideEmployees" aggregate="sum" /> 
     <filter> 
      <condition attribute="customertypecode" operator="eq" value="2" /> 
     </filter> 
    <link-entity name="contact" from="parentcustomerid" to="accountid" alias="contact"> 

     <attribute name="bio_webuseraccountstatus" alias="count_bio_webuseraccountstatus" aggregate="countcolumn" /> 

     <attribute name="bio_webuseraccountstatus" alias="bio_webuseraccountstatusgroupby" groupby="true" /> 

     </link-entity> 
     </entity> 
    </fetch> 

爲bio_webuseraccountstatus的值可以是Active, Inactive, Disabled, Pending, etc..

在FetchXML有沒有辦法做一個case語句,你「不活躍」爲每一個沒有價值噸等於「積極」?

正如你可以看到我一直在試圖解決這個問題within the reporting layer,但我遇到了很多「字符串格式」問題。

這可以用數據集圖層(fetchxml)來完成嗎?

+0

這是一個很好的問題! – 2015-10-15 16:57:06

回答

1

根據this Microsoft forum post

有沒有同等功能的FetchXml。相反,您將需要返回每個字段值,並在調用代碼中處理CASE邏輯。如果要在報告中使用此FetchXml,則可以在報告的計算字段中實現CASE邏輯。