In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Source: https://forums.opentext.com/forums/discussion/61542/compare-current-row-with-previous-row-value#latest
In Birt, we usually use SQL window function or report script to realize intra-group cross-line calculation, but the code is complicated. In this case, SPL can be used to assist the report tool. The following is illustrated by an example.
In this example, there are three fields, where SELLERID is the grouping field, DAY is the field to be compared, and the field type is date-time type. You need to design a grouping table. SELLERID is the grouping field, and the detail fields are DAY, AMOUNT and the calculation column SHIFTTIME. The DAY stored in SHIFTTIME differs from the DAY in the last record in this group by a few days. The source data is as follows:
Use the aggregator to organize the data:
A
1=connect ("db") .query ("select SELLERID, DAY,AMOUNT,0 as SHIFTTIME from SALES order by SELLERID, DAY") queries the database, sorts the SELLERID and DAY fields, and produces an extra column of constant spare 2=A1.group (SELLERID) .run (~ .run (interval (DAY [- 1], DAY): SHIFTTIME) grouped by SELLERID, and modify the calculation column SHIFTTIME3=A2.union () in each group of data and merge each group of data 4return A3 to return the calculation results to the report tool.
Save the above SPL code as sales.dfx and introduce it into the Birt report. For Birt to call SPL, please refer to "BIRT calling SPL script".
Step 1: add an aggregator JDBC data source.
Step 2: create the dataset and edit the Query Text.
Step 3: create a report. The report is designed as follows:
Step 4: WEB preview. The preview result is as follows:
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.