0

我是使用 Cognos 的新手,我有整个项目的数据,我需要创建某种表格或交叉表来计算每年的整个项目以及其中有多少是活动的、取消的和不活动的

我尝试过使用交叉表但没有成功。

ProjectId  Status          Date
 1589   Active          8/29/2018
 1566   Inactive    4/17/2018
 1042   Cancelled   1/6/2014
 1374   Completed   1/20/2015
 1543   Completed   8/4/2014
 1065   Cancelled   7/15/2014
 1397   Completed   10/1/2012
 1520   Inactive    4/13/2017
 1420   Completed   1/1/2015
 1443   Completed   1/1/2015
 1048   Cancelled   10/16/2014
 1002   Active          2/6/2017
 1357   Completed   1/19/2017
 1606   Active          11/6/2018

输出应如下所示

New Projects    Active      Cancelled/Terminated/Inactive   Carried Forward  
2013             32            45          4         11         30  
2014             45            75          17        14         44  
2015             46            90          25        21         44  
2016             30            74          27        10         37  
2017             82            119         11        26         82  
2018             86            168         29        24         115 
2019             23            138         9         4          125
4

1 回答 1

0

与 -- 项目 ID、状态、日期

理想的情况是我们有一个年份的数据项。如果没有,得到年份

  extract(year, Date)

计算数据项:每个计数

例如,这是用于活动

if (status = 'Active')Then(1)Else(0)

对于属性确保聚合设置为总计

添加列应该会给你计数

于 2019-08-02T21:22:10.683 回答