Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Schedule Duplicating Records
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Schedule Duplicating Records
 Login/Join
 
Member
posted
I'm receiving a scheduled report that I made just fine. However, the report window displays a copy of the report for some reason. It doesn't do this when I run the report in AppStudio, just when I receive the schedule through email. Code is below.

-SET &ECHO=ON;
SET EMPTYREPORT=ON
SET ASNAMES=ON
SET LINES=99999


TABLE FILE CUSTOMERS
SUM
CNT.CUSTOMERS.CUSTOMERS.FIELD1 AS 'COUNTS'
BY CUSTOMERS.CUSTOMERS.FIELD1
WHERE TOTAL CNT.CUSTOMERS.CUSTOMERS.FIELD1 GT 1;
WHERE CUSTOMERS.CUSTOMERS.FIELD1 IS NOT '';
WHERE CUSTOMERS.CUSTOMERS.CUSTOMERID IS NOT '';
ON TABLE HOLD AS MASTER
END
-RUN


JOIN
CUSTOMERS.CUSTOMERS.FIELD1 IN CUSTOMERS TO MULTIPLE
MASTER.MASTER.FIELD1
IN MASTER TAG J1 AS J1
END


TABLE FILE CUSTOMERS
PRINT
J1.MASTER.FIELD1 AS 'LEGACYID'
CUSTOMERS.CUSTOMERS.CUSTOMERID
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT HTML
END
-RUN
-EXIT

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 12 | Registered: August 28, 2019Reply With QuoteReport This Post
Master
posted Hide Post
Are you wanting to see the report as an attachment in the email rather than embedded in the email?

If so, then go to the scheduled job and open it up. Go to the Distributions tab and open the method. Then in the email information about halfway down, change the radio button to 'Send all reports as attachments'



Hallway
WF(Prod):8202M
WF(Test):8202M
OS/Platform:Win 10
Outputs:All
 
Posts: 485 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Member
posted Hide Post
Hi Hallway,

Actually, I am receiving the report as an attachment, which is good. But the values within that report are duplicated. For example, when I review the results window, I should see;


LEGACYID CUSTOMERID
GSX010259 2552723
GSX010259 2696311

But what I'm getting instead is;

LEGACYID CUSTOMERID
GSX010259 2552723
GSX010259 2696311
LEGACYID CUSTOMERID
GSX010259 2552723
GSX010259 2696311
 
Posts: 12 | Registered: August 28, 2019Reply With QuoteReport This Post
Master
posted Hide Post
Can you replicate the error using a master file from the ibisamp library? Like the car file? That way we can run it locally and better troubleshoot.


Hallway
WF(Prod):8202M
WF(Test):8202M
OS/Platform:Win 10
Outputs:All
 
Posts: 485 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Master
posted Hide Post
quote:
IS NOT ''

Also, maybe try using NE '' instead.
WHERE CUSTOMERS.CUSTOMERS.CUSTOMERID NE '';
  


Hallway
WF(Prod):8202M
WF(Test):8202M
OS/Platform:Win 10
Outputs:All
 
Posts: 485 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Since MASTER file become your main selection table : it's the file that contain only the key field that you want, try with the below JOIN instead (also have included Hallway suggestion).
I would not be surprise that the problem is the JOIN … MULTIPLE

Another point is that in your original JOIN the child file (MASTER) is a none indexed alpha file. This may also cause issue in a JOIN

TABLE FILE CUSTOMERS
SUM CNT.CUSTOMERS.CUSTOMERS.FIELD1 AS 'COUNTS'
BY CUSTOMERS.CUSTOMERS.FIELD1 
WHERE TOTAL CNT.CUSTOMERS.CUSTOMERS.FIELD1 GT 1;
WHERE CUSTOMERS.CUSTOMERS.FIELD1 NE '';
WHERE CUSTOMERS.CUSTOMERS.CUSTOMERID NE '';
ON TABLE HOLD AS MASTER
END
-RUN

JOIN MASTER.MASTER.FIELD1 IN MASTER TAG T1
  TO CUSTOMERS.CUSTOMERS.FIELD1 IN CUSTOMERS TAG T2 AS J1
END

TABLE FILE CUSTOMERS
PRINT T1.FIELD1 AS 'LEGACYID'
      T2.CUSTOMERID
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT HTML
END
-RUN


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2223 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Guru
posted Hide Post
or only adjust the join:
JOIN
CUSTOMERS.CUSTOMERS.FIELD1 IN CUSTOMERS TO UNIQUE
MASTER.MASTER.FIELD1
IN MASTER TAG J1 AS J1
END  


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
 
Posts: 411 | Location: Europe | Registered: February 05, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Schedule Duplicating Records

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.