Solved

Select Cross-tab total

Posted on 2016-08-08
2
68 Views
Last Modified: 2016-08-08
Hi Experts

I have a cross-tab table that has the weekending dates as rows and the day of the week as columns.  The 7 days of the week are then totaled.  What I need to do is to be able to select ONLY those that have a summary total of 0.  I can't get this to work at all.  It seems like it should be very simple.  When I go to select the summary column and have it show only those equal to zero, it turns everything to zero's and I get a page of nothing but zero's.  

Any help would be greatly appreciated.

Attached is an image of my cross-tab as well as my Crystal Report.  You can see it is very simple.  Below is the SQL query.  

**I was asked my the moderator to restate the question and re-post.  

Andy  

 SELECT "TIME_DIM"."WEEK_END_DT", "TIME_DIM"."DD_NAME", "NYP_ROUTE_DIM"."ROUTE_CD", "NYP_DRAW_FACT"."TOT_RET", "NYP_HIERARCHY_DIM"."REGION_NAME"
 FROM   (("NYP_RPT"."NYP_DRAW_FACT" "NYP_DRAW_FACT" INNER JOIN "NYP_RPT"."NYP_ROUTE_DIM" "NYP_ROUTE_DIM" ON "NYP_DRAW_FACT"."ROUTE_ID"="NYP_ROUTE_DIM"."ROUTE_ID") INNER JOIN "REPORT"."TIME_DIM" "TIME_DIM" ON "NYP_DRAW_FACT"."DRAW_DT_ID"="TIME_DIM"."TIME_ID") INNER JOIN "NYP_RPT"."NYP_HIERARCHY_DIM" "NYP_HIERARCHY_DIM" ON "NYP_ROUTE_DIM"."HIER_ID"="NYP_HIERARCHY_DIM"."HIER_ID"
 WHERE   NOT ("NYP_ROUTE_DIM"."ROUTE_CD" LIKE '2%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'BL1135%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'BL1137%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'BS1145%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'BS1146%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'ca1373%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'CA1374%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'DT%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'fl1149%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'PI1104%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'PI1122%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'RC1109%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'SU1259%' OR "NYP_ROUTE_DIM"."ROUTE_CD" LIKE 'su1267%') AND ("TIME_DIM"."WEEK_END_DT">={d '2016-06-05'} AND "TIME_DIM"."WEEK_END_DT"<={d '2016-07-31'}) AND ("NYP_HIERARCHY_DIM"."REGION_NAME"='CALIFORNIA SC' OR "NYP_HIERARCHY_DIM"."REGION_NAME"='CHICOPEE SC' OR "NYP_HIERARCHY_DIM"."REGION_NAME"='FLORIDA EAST SC' OR "NYP_HIERARCHY_DIM"."REGION_NAME"='FLORIDA WEST SC' OR "NYP_HIERARCHY_DIM"."REGION_NAME"='PHILADELPHIA SC' OR "NYP_HIERARCHY_DIM"."REGION_NAME"='PORT MORRIS SUBURBAN SC' OR "NYP_HIERARCHY_DIM"."REGION_NAME"='ROCHESTER SC' OR "NYP_HIERARCHY_DIM"."REGION_NAME"='WHITE OAK SC')
MISSING_RETURNS_CROSSTAB.rpt
crosstab.jpg
0
Comment
Question by:spudmcc
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 41747202
As I stated in your other version I don't believe this can be done in a cross tab.

I have modified your report slightly and believe I produced what you want using groups and group selection.

mlmcc
MISSING_RETURNS_CROSSTAB-rev1.rpt
0
 

Author Closing Comment

by:spudmcc
ID: 41747538
Thanks so much.  I knew you were correct but I was re-posting the question per a request from the moderator.  I appreciate your time and knowledge as always.  This will be very helpful.  

Andy
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question