Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Using XMl files and generating data

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Using XMl files and generating data
 Login/Join
 
Gold member
posted
Hi ,

I have an xml file like this :
<RECORDS>  
   <RECORD>
      <PROP NAME="dimension_id">
         <PVAL>9927083</PVAL>
      </PROP>
      <PROP NAME="external_id">
         <PVAL>34257_34259</PVAL>
      </PROP>
   </RECORD>
  <RECORD>
      <PROP NAME="dimension_id">
         <PVAL>9927082</PVAL>
      </PROP>
      <PROP NAME="external_id">
         <PVAL>34257_34260</PVAL>
      </PROP>
   </RECORD>
   <RECORD>
      <PROP NAME="dimension_id">
         <PVAL>9997319</PVAL>
      </PROP>
      <PROP NAME="external_id">
         <PVAL>620270</PVAL>
      </PROP>
   </RECORD>
   <RECORD>
      <PROP NAME="dimension_id">
         <PVAL>9997319</PVAL>
      </PROP>
      <PROP NAME="external_id">
         <PVAL>620273</PVAL>
      </PROP>
      <PROP NAME="internal_id">
         <PVAL>9975999</PVAL>
      </PROP>
   </RECORD>
<RECORD>
      <PROP NAME="dimension_id">
         <PVAL>9997319</PVAL>
      </PROP>
      <PROP NAME="external_id">
         <PVAL>620274</PVAL>
      </PROP>
      <PROP NAME="internal_id">
         <PVAL>9975998</PVAL>
      </PROP>
   </RECORD>
</RECORDS>



I am creating a master file out of this and the output looks like this

NAME PVAL
dimension_id 9927083
external_id 34257_34259
dimension_id 9927082
external_id 34257_34260
dimension_id 9997319
external_id 620270
dimension_id 9997319
external_id 620273
internal_id 9975999
dimension_id 9997319
external_id 620274
internal_id 9975998


For the below code , am getting teh output like
  
SET ACROSSPRT = COMPRESS

TABLE FILE TEST_XML
PRINT
PVAL
ACROSS NAME
END




Output :

dimension_id external_id internal_id
9927083 34257_34259 9975999
9927082 34257_34260 9975998
9997319 620270 .
9997319 620273 .
9997319 620274 .

But i need the output like this :

dimension_id external_id internal_id
9927083 34257_34259 .
9927082 34257_34260 .
9997319 620270 .
9997319 620273 9975999
9997319 620274 9975998

Can anyone help me on this ?
This is in version 7.6.9

Thanks!

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


WebFOCUS 7.6.9
Windows
Excel, HTML, PDF
 
Posts: 71 | Registered: April 17, 2009Report This Post
Gold member
posted Hide Post
Adding on to this , i tried the following way ,

 
DEFINE FILE EGEE_XML_AUTOGENDIMENSIONEXTERNAL
DIMID/A100 = IF NAME EQ 'dimension_id' THEN PVAL ELSE '';
-*DIMID/A100 = IF NAME EQ 'dimension_id' THEN PVAL ELSE IF NAME EQ 'external_id' THEN PVAL ELSE IF NAME EQ 'internal_id' THEN PVAL ELSE '';
EXTID/A100 = IF NAME EQ 'external_id' THEN PVAL ELSE '';
INTID/A100 = IF NAME EQ 'internal_id' THEN PVAL ELSE '' ;
A/A2='A';
END

TABLE FILE EGEE_XML_AUTOGENDIMENSIONEXTERNAL
PRINT
RECORD NOPRINT
DIMID
EXTID
INTID
BY A
-*BY DIMID NOPRINT
-*BY EXTID NOPRINT
-*ACROSS NAME
-*ON TABLE HOLD AS HLD_TEST
END


The out put comes in the below format . How do i merge these into a singlr row for a dimension id

dimension_id external_id internal_id
9927083
34257_34259
.
9927082
34257_34260
.

Thanks!


WebFOCUS 7.6.9
Windows
Excel, HTML, PDF
 
Posts: 71 | Registered: April 17, 2009Report This Post
Virtuoso
posted Hide Post
The first result you get is in fact a field name and a value in one table
You need to convert that firts to a real table that holds two fields and a value




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
I tried that as well and it didnt work .


WebFOCUS 7.6.9
Windows
Excel, HTML, PDF
 
Posts: 71 | Registered: April 17, 2009Report This Post
Virtuoso
posted Hide Post
Example:
DEFINE FILE wsdemo/XMLTEST2
RECID/I5 WITH RECORD = LAST RECID + 1;
END
TABLE FILE wsdemo/XmlTEST2
SUM PVAL
ACROSS NAME
BY RECID
END
  


My master
FILENAME=WSDEMO_XMLTEST2, SUFFIX=XML     ,
 DATASET=wsdemo/xmltest2.xml, $
  SEGMENT=RECORDS, SEGTYPE=S0, $
    FIELDNAME=RECORDS, ALIAS=RECORDS, USAGE=A1, ACTUAL=A1, ACCESS_PROPERTY=(INTERNAL), $
  SEGMENT=RECORD, SEGTYPE=S0, PARENT=RECORDS, $
    FIELDNAME=RECORD, ALIAS=RECORD, USAGE=A1, ACTUAL=A1, ACCESS_PROPERTY=(INTERNAL),
      REFERENCE=RECORDS, PROPERTY=ELEMENT,  $
  SEGMENT=PROP, SEGTYPE=S0, PARENT=RECORD, $
    FIELDNAME=PROP, ALIAS=PROP, USAGE=A1, ACTUAL=A1, ACCESS_PROPERTY=(INTERNAL),
      REFERENCE=RECORD, PROPERTY=ELEMENT,  $
    FIELDNAME=PVAL, ALIAS=PVAL, USAGE=A10, ACTUAL=A10,
      REFERENCE=PROP, PROPERTY=ELEMENT,  $
    FIELDNAME=NAME, ALIAS=NAME, USAGE=A10, ACTUAL=A10,
      REFERENCE=PROP, PROPERTY=ATTRIBUTE,  $
  


Result
  PAGE     1
  
  
         NAME 
         dimension_  external_i  internal_i  
  RECID                                      
  -------------------------------------------
      1  9927083     34257_3425  .           
      2  9927082     34257_3426  .           
      3  9997319     620270      .           
      4  9997319     620273      9975999     
      5  9997319     620274      9975998      

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


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Using XMl files and generating data

Copyright © 1996-2020 Information Builders