Ich arbeite daran, zwei JMP-Tabellen zu verbinden.
Mit Ausnahme einer Zeile werden alle Daten korrekt verbunden. Ich habe geprüft, ob sie gleich kopiert sind und dieselben Merkmale aufweisen, und mit den Übereinstimmungsflags festgestellt, welche Tabelle den Fehler verursacht. Obwohl ich festgestellt habe, welche Tabelle das Problem ist, weiß ich immer noch nicht, warum?
Tabelle 1:
New SQL Query(
QueryName( "1. Curd xfer with time offsets" ),
CustomSQL(
"SET NOCOUNT ON
DECLARE @StartDate DateTime
DECLARE @EndDate DateTime
SET @StartDate = '20170115 00:00:00.000'
SET @EndDate = '20170122 00:00:00.000'
SET NOCOUNT OFF
SELECT * FROM (
SELECT History.TagName, DateTime, Value, vValue, StartDateTime
FROM History
WHERE History.TagName IN ('DAL.CP5.CHEESE.CVSTATUS.CURD_XFER_VAT')
AND wwRetrievalMode = 'Cyclic'
AND wwResolution = 30000
AND wwVersion = 'Latest'
AND DateTime >= @StartDate
AND DateTime <= @EndDate) temp WHERE temp.StartDateTime >= @StartDate"
)
) << Run;
While (try(dt1<<GET name=""></GET>
Datentabelle 2:
New SQL Query(
QueryName( "3. Tags with Values" ),
CustomSQL(
"SET NOCOUNT ON
DECLARE @StartDate DateTime
DECLARE @EndDate DateTime
SET @StartDate = '20170115 00:00:00.000'
SET @EndDate = '20170122 00:00:00.000'
SET NOCOUNT OFF
SELECT * FROM (
SELECT History.TagName, DateTime, Value, vValue, StartDateTime
FROM History
WHERE History.TagName IN
('DAL.CP5.CHEESE.CCB01.LT_01684_RAW', 'DAL.CP5.CHEESE.CCB01.LT_01685_RAW', 'DAL.CP5.CHEESE.CCB01.LT_01686_RAW', 'DAL.CP5.CHEESE.CCB01.LT_01687_RAW', 'DAL.CP5.CHEESE.CCB01.LT_01688_RAW', 'DAL.CP5.CHEESE.CCB01.TIC_01510_PV', 'DAL.CP5.CHEESE.CCB01.FIC_01410_PV', 'DAL.CP5.CHEESE.CVSTATUS.CURD_XFER_VAT', 'DAL.CP5.CHEESE.CCB01.LT_01662_RAW','DAL.CP5.CHEESE.CCB01.TE_01590', 'DAL.CP5.CHEESE.CVSTATUS.CURD_XFER_RECIPE', 'DAL.CP5.CHEESE.CCB01.LT_01652_RAW', 'DAL.CP5.CHEESE.CCB01.LT_01662_RAW', 'DAL.CP5.CHEESE.CCB01.LT_01686_RAW', 'DAL.CP5.CHEESE.CCB01.CTK02010.MCCB_02310A_RAW', 'DAL.CP5.CHEESE.CCB01.CTK02020.MCCB_02320A_RAW', 'DAL.CP5.CHEESE.CCB01.CTK02030.MCCB_02330A_RAW', 'DAL.CP5.CHEESE.CCB01.CTK02040.MCCB_02340A_RAW', 'DAL.CP5.CHEESE.CCB01.CTK02050.MCCB_02350A_RAW', 'DAL.CP5.CHEESE.CCT01.CURD_LT', 'DAL.CP5.CHEESE.CCB01.PRGM_BELT_STOP_CTR1_ACC', 'DAL.CP5.CHEESE.CCB01.PRGM_BELT_STOP_ACC', 'DAL.CP5.CHEESE.CCB01.LT_01672_RAW')
AND wwRetrievalMode = 'Cyclic'
AND wwResolution = 30000
AND wwVersion = 'Latest'
AND DateTime >= @StartDate
AND DateTime <= @EndDate) temp WHERE temp.StartDateTime >= @StartDate"
)
) << Run;
While (try(dt3<<GET name=""></GET>
Die Daten, die nicht übertragen werden, sind für DAL.CP5.CHEESE.CCB01.LT_01672_RAW.
Kann jemand helfen?
Vielen Dank!
Hallo,
Wenn Sie sich Ihre Skripte schnell ansehen, sehen Sie, dass Sie eine Spalte zweimal definiert haben ( DAL.CP5.CHEESE.CCB01.LT_01672_RAW)
JMP fügt dem wiederholten Namen der Spalte ein numerisches Suffix hinzu. In Ihrem Fall "DAL.CP5.CHEESE.CCB01.LT_01672_RAW 2"
Daher erzeugt Ihre gestapelte Datentabelle höchstwahrscheinlich nicht die erwartete Ausgabe.
Wenn Sie Beispiele für jede der drei Datentabellen bereitstellen könnten, können wir das Problem weiter eingrenzen.
- Stan
Stack produziert wahrscheinlich nicht das, was Sie erwarten
Beachten Sie, dass Sie dieselbe Spalte zweimal erstellen