問題描述
按序列順序過濾 Birt 表 (Filter in serial order for Birt tables)
我在 Birt 報告中有一個表格,我想在其中顯示客戶流程的後 10 個處理時間。一個簡單的“底部 n”過濾器非常有效 ‑ 但我的客戶來了。他說他想要我創建的倒數 10 個表,但沒有不一致的值,這些值是由單個進程產生的,每月只運行一次。
因此該表應該顯示倒數 10 個處理時間,但是它應該只包含特定進程的進程,例如一個月內運行進程的 0.01% 以上。
我嘗試了一個額外的過濾器,它只顯示運行頻率超過 0.01% 的進程總流程 ‑ 但現在我的結果表是空的。
是否有可能實現 Birt 過濾器優先 所有處理的進程少於進程總數的 0.01 %,之後構建預過濾結果集的後 10 個列表?我無法更改 SQL 數據集,因為它也在其他一些表中使用。
這是我的過濾器,如果我只應用其中一個,它們可以正常工作 ‑ 兩者一起我收到一個空結果集。
<list‑property name="filter">
<structure>
<property name="operator">ge</property>
<expression name="expr" type="javascript">row["TOTAL"]/row["Ov_TOTAL"]</expression>
<simple‑property‑list name="value1">
<value>0,01</value>
</simple‑property‑list>
<property name="updateAggregation">true</property>
</structure>
<structure>
<property name="operator">bottom‑n</property>
<expression name="expr" type="javascript">row["AVG_DURATION"]</expression>
<simple‑property‑list name="value1">
<value>10</value>
</simple‑property‑list>
<property name="updateAggregation">true</property>
</structure>
</list‑property>
參考解法
方法 1:
I gave it a try and it works for me. The only difference with your example is, in my case the ratio is already computed when the filter is applied: see "shareVolume" column below.
<list‑property name="filter">
<structure>
<property name="operator">ge</property>
<expression name="expr" type="javascript">row["shareVolume"]</expression>
<simple‑property‑list name="value1">
<value>0.01</value>
</simple‑property‑list>
<property name="updateAggregation">true</property>
</structure>
<structure>
<property name="operator">bottom‑n</property>
<expression name="expr" type="javascript">row["value2"]</expression>
<simple‑property‑list name="value1">
<value>3</value>
</simple‑property‑list>
<property name="updateAggregation">true</property>
</structure>
</list‑property>
To achieve this i computed the ratio in the dataset. I just added two computed columns: the SQL is unchanged and other existing report components using the same dataset still perfectly work.