如何在Crystal Reports中的“交叉表”中过滤信息 [英] How to filter information within a Cross Tab in Crystal Reports

查看:319
本文介绍了如何在Crystal Reports中的“交叉表”中过滤信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个包含过滤数据和非过滤数据的单个交叉表。我知道我可以通过在不同的组中创建单独的交叉表,然后在组级别上使用筛选器专家,但是我需要结果显示在相同的交叉表中。我相信类似的解决方案,这可能会工作,但不清楚的实施:



我试图报告已知客户的频率,在客户(给定一个客户编号)。



我已经创建了一个带有下列值的交叉表的报表:

行:AR_CUST.STR_ID提供商店号码)

Columns:PS_TKT_HIST_DAT(给出购买日期)

汇总字段:

AR_CUST.CUST_NO的DistinctCount(给出唯一客户号码的计数)

PS_TKT_HIST.TKT_NO的DistinctCount(给出票数)

嵌入式摘要(给出唯一客户与票数之比)

这个工作原理完全一样。



我们有一个AR_CUST.CUST_NO值用于步入客户(我们不保留使用此客户编号购买的客户信息)。所以我想用相同的信息来计算两个额外的交叉表。第一个将排除PS_TKT_HIST.TKT_NO在PS_TKT_HIST.CUST_NO等于* WI(这不是通配符,这是SQL中的确切条目)时的所有条目。第二个不会排除* WI记录,而是将作为独立客户的* WI客户编号下的每个客票实例计数。要澄清的是,在第二个报告中,我在交叉表中嵌入的摘要将是:当CUST_NO <> * WI +
$ b时,CUST_NO的DISTINCT_COUNT为

$ b当CUST_NO = * WI时,CUST_NO的计数是否可以通过将三个交叉表中嵌入的汇总值记录为变量,然后将这些变量插入第四个交叉表?

谢谢

Tyler

解决方案

我不认为你可以从3个交叉选项卡中提取嵌入的摘要,并插入第4个交叉表。 可能是我不知道 .....



但是我可以建议你解决这个问题。



由于您有3个交叉标签...


  1. 在主要报告中报告并实施3个子报告中的个别交叉标签。 使用交叉标签不是使用交叉标签,而是通过将重复字段放在详细信息部分和摘要在页脚部分,并用线条划分细节部分,并使报告与交叉表完全一样。

     行列1 | Column2 | Column3 // Group Header as cross tab columns 
    -------------------------------------
    1 10 | 10 | 10 //作为交叉表行的细节部分
    2 20 | 20 | 20 //作为交叉表行的详细部分
    ------------------------------------- - //行将是交叉表
    30 |中的行对象30 | 30 //组页脚作为交叉表摘要

    上面的设计将完全按照corss选项卡显示。 / b>现在从3个子报告中使用共享变量获取所需的值,并在主子报告中执行计算或按照您的要求另一个子报告。

例如在子报表创建像这样:

 共享NumberVar x; 

X:= CUST_NO的DISTINCT_COUNT当CUST_NO<> * WI +
当CUST_NO = * WI



时,CUST_NO的计数

 共享NumberVar x; 
x

在所有子报表中执行同样的操作。



这个方法会给你交叉表输出,同时你可以制定计算。



让我知道怎么回事


I am trying to create a single cross tab that includes both filtered and non-filtered data. I understand that I could do this by creating separate cross tabs in separate groups, then using filter expert on the group level, but I need the results to displayed in the same cross tab. I believe a similar solution to this might work, but am unclear on the implementation:
Crystal Reports Cross-Tab Column Totals as Variables

I am attempting to report on the frequency of known customers and walk-in customers (given a set customer number).

I have created a report with a cross tab with the following values:

Rows: AR_CUST.STR_ID (gives store number)
Columns: PS_TKT_HIST_DAT (gives purchase date)

Summarized Fields:
DistinctCount of AR_CUST.CUST_NO (gives count of unique customer numbers)
DistinctCount of PS_TKT_HIST.TKT_NO (gives count of tickets)
Embedded Summary (gives ratio of unique customers to number of tickets)

This works exactly as it should.

We have one value of AR_CUST.CUST_NO that is used for walk-in customers (we don't retain customer information for purchases using this customer number). So I want to calculate two additional cross tabs with the same information. The first would exclude all entries in PS_TKT_HIST.TKT_NO when PS_TKT_HIST.CUST_NO equals *WI (that's not a wildcard, that's the exact entry in SQL). The second wouldn't exclude *WI records, but would count each instance of a ticket under the *WI customer number as a separate customer. To clarify that, in the second report, my embedded summary in the cross tab would be:

DISTINCT_COUNT of CUST_NO when CUST_NO <> *WI +
COUNT of CUST_NO when CUST_NO = *WI

Is this possible by recording embedded summary values from the three cross tabs as variables, and then inserting those variables into a fourth crosstab?

Thanks

Tyler

解决方案

I don't think you can extract the embeeded summary from 3 cross tabs and insert in 4th cross tab. May be I don't know.....

But I can suggest you one work around for this.

Since you have 3 cross tabs...

  1. Take 3 sub reports in the main report and implement the individual cross tab in the 3 sub reports..
  2. Implement the cross tab not by using the cross tab but by placing the recurring fields in the detail section and summary in the footer section and divide the detail sections using lines.. and make the report as exactly as cross tab.

         Row    Column1 | Column2 | Column3   //Group Header as cross tab columns
        -------------------------------------
         1       10     |     10   |  10     //Detail Section as cross tab rows
         2       20     |     20   |  20     //Detail section as cross tab rows
        --------------------------------------  // Lines will be line objects in crosstab
                 30     |     30   |  30     //Group Footer as cross tab summary
    

    Above design will give your out exactly as corss tab.

  3. Now from 3 sub reports take the required values using the Shared Varialbes and perform your calcultion in main subreport or another sub report as per your requirement.

For eg in subreport create like this:

Shared NumberVar x;

X:=DISTINCT_COUNT of CUST_NO when CUST_NO <> *WI +
COUNT of CUST_NO when CUST_NO = *WI 

In main report

Shared NumberVar x;
x

Perform same in all sub reports.

This approach will give you cross tab output at the same time you can manuplate the calculations.

Let me know how it goes

这篇关于如何在Crystal Reports中的“交叉表”中过滤信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆