Focal Point
[CLOSED] CNT.DST issue

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1467078286

June 24, 2016, 01:57 PM
MeM
[CLOSED] CNT.DST issue
Hi,

I'm calculating Count of distinct customername and when I'm writing CNT.DST.CUSTOMERNAME AS CUSTOMERCOUNT, in the output I'm also getting a blank column with the heading customername. Can anybody please sugeest why I'm getting this column with the column customercount?

Thank you.

This message has been edited. Last edited by: MeM,


WebFOCUS 8.2.02
Windows, All Outputs
June 24, 2016, 02:03 PM
Ricardo Augusto
Hello,

Can you reproduce your code using CAR.MAS ?


WebFOCUS 8.1.05 / APP Studio
June 24, 2016, 02:24 PM
BabakNYC
Or provide us the code you have created so we can look it over, but an example using one of the tables in /apps/ibisamp will be a lot easier to understand.


WebFOCUS 8206, Unix, Windows
June 24, 2016, 02:56 PM
jcannavo
You don't have a BY in there anywhere do you? Code would definitely help.


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
June 24, 2016, 03:04 PM
MeM
Here is the code:

TABLE FILE ABI_CUSTOMER_V
SUM
CNT.DST.CUSTOMERNAME AS YTDCUSTOMERCOUNT
BY OFFI
BY DIV
WHERE WEEKENDINGDATE GE &FIRSTWEEKENDINGDATE;
WHERE WEEKENDINGDATE LE &WEEKENDINGDATE;
ON TABLE HOLD AS ABI_CUSTOMERNAMECOUNT
ON TABLE SET BYDISPLAY ON
END


WebFOCUS 8.2.02
Windows, All Outputs
June 24, 2016, 03:16 PM
Doug
Can you reproduce your code using CAR.MAS as we don't have access to your view?

What the title for the "CNT.DST.CUSTOMERNAME" field?
June 24, 2016, 03:18 PM
jcannavo
Interesting. I tried something similar:

TABLE FILE RPT_CAACTIVITIES
SUM    CNT.DST.RPT_CAACTIVITIES.RPT_CAACTIVITIES.CUSTOMER_NAME
BY  RPT_CAACTIVITIES.RPT_CAACTIVITIES.LOCATION
WHERE RPT_CAACTIVITIES.RPT_CAACTIVITIES.REQUEST_STARTED GE DT(2016-06-01 12:00:00AM);
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
END  


When I run this as expected I get two columns: "LOCATION" and "COUNT DISTINCT Customer Name".

Are you able to reproduce a similar result with using the CAR file?


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
June 24, 2016, 03:26 PM
Doug
Weird... This works...
TABLE FILE CAR
SUM CNT.DST.MODEL
BY  COUNTRY
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
END

Produces this:
            COUNT 
         DISTINCT
COUNTRY     MODEL
ENGLAND         4 
FRANCE          1 
ITALY           4 
JAPAN           2 
W GERMANY       7 

But, then again, CAR is a FOCUS DB, not a view...
June 24, 2016, 03:48 PM
MeM
When I'm running this code I'm getting the following columns:
Country, Bodytype, Countmodel, Model. I'm trying to understand why the column model is coming.


-SET &ECHO = 'ALL';
SET ASNAMES = ON

TABLE FILE CAR
SUM CNT.DST.MODEL AS COUNTMODEL
BY COUNTRY
BY BODYTYPE
ON TABLE HOLD AS A
END


TABLE FILE A
PRINT *
END
-EXIT


WebFOCUS 8.2.02
Windows, All Outputs
June 24, 2016, 04:03 PM
Doug
TABLE FILE CARSUM
CNT.DST.MODEL AS COUNTMODEL
BY COUNTRY
BY BODYTYPE
ON TABLE HOLD AS A
END"

OOooo I C now... Your going to a hold file. That's a whole new story.
The "Extra' column is the source column for the DST.CNT. Check out the "HOLDLIST" option. I'm feeling generous today so I'll give it to you here, add "ON TABLE SET HOLDLIST PRINTONLY" just before your "ON TABLE HOLD AS A" statement.
June 24, 2016, 04:04 PM
Tony A
Use SET HOLDLIST = PRINTONLY to only hold the columns that are specified.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
June 24, 2016, 04:13 PM
Doug
That's the call Tony...

I like being selective an explicit. So, I do it on a TABLE ... HOLD by TABLE ... HOLD basis: "ON TABLE SET HOLDLIST PRINTONLY".
June 27, 2016, 07:51 AM
MeM
Thank you all. Adding ON TABLE SET HOLDLIST PRINTONLY before 'ON TABLE HOLD AS A' solved the problem.