cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping - Filtering criteria

Former Member
0 Kudos

Hi Friends,

In my source structure i have one of the field called "Purchase ID". I need to map this field to target based on one criteria as follows :

Only the following Purchase ID's should be considered from source xml.

Purchase ID

100

101

Requriment :

If there is any other values for Purchase ID other than (100 ,101) . Those set of records need to be dicarded . It should not go to target remaning other valid records will have to go to target.

For eg :

We have 100 records out ofwhich 50 records are not having the values either 100 or 101 hence this records should not go to

Target.

Kindly guide me.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use FixValues function, in this put 100 & 101 in key and value columns both.

And put null value( don't enter anything in defualt value) and choose 'use default value'.

Source --> FixValues ---> equalS -


>not -


> ifWithoutElse -


> Target

Constant[]-> Source>

Constant[] is given to the second input of equalS.

-Supriya.

Edited by: Supriya Sawant on Oct 7, 2010 8:16 AM

Former Member
0 Kudos

Hi supriya,

It is not working .

In Test tab :In the first node of records i have given Purchase Id ; 999

In the second node of records i have given Puchase id : 101

Output :

I am getting both 2 nodes in the target.

My requirement is :It should not populate the entire first node of records since purchase id is : 500

In this case i should see only second node of records only.

Kindly guide me.

Renu

Former Member
0 Kudos

Hi,

Put remove conctext after Source field in the above mapping.

You have to use this function at 2 places in the given mapping.

-Supriya.

Former Member
0 Kudos

Hi Supriya,

My source structure

{code)

<?xml version="1.0" encoding="UTF-8"?>

<root>

<Table>

<CarrierDescription/>

<ManufacturerName/>

<ManufacturerCode/>

<Purchaseid>100</Purchaseid>

<EquipmentName/>

<EquipmentType/>

<EquipmentShortDescription/>

<EquipmentLongDescription/>

<SugRetailPrice/>

<DisplayPrice/>

<EquipmentPrice/>

<NumericCost/>

<RebateAmount/>

<PriceAfterRebate/>

<RebateDescription/>

<EquipmentImageFileSmall/>

<EquipmentImageFileMedium/>

<EquipmentImageFileLarge/>

<ManufacturerLogo/>

<PurchaseMode>erwer</PurchaseMode>

<ProductLink/>

<UPC/>

<CompatibleAccessoriesPageURL/>

<IsBelowIMAP/>

</Table>

</root> {code)

Former Member
0 Kudos

My target structure

  <?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_ProdCatalog_Simplexity xmlns:ns0="http://palm.com/PALMPRODCATALOG/Simplexity"><STATEMENT_STORE_SIMPLEXITY_FEED><TABLENAME ACTION="UPDATE_INSERT"><TABLE>STORE_SIMPLEXITY_FEED</TABLE><ACCESS><CARRIER_DESC></CARRIER_DESC><MANUFACTURER_NAME></MANUFACTURER_NAME><Manufacturer_Code></Manufacturer_Code><*PURCHASEID*>101</*PURCHASEID*><EQUIPMENT_NAME></EQUIPMENT_NAME><EQUIPMENT_TYPE></EQUIPMENT_TYPE><EQUIPMENT_SHORT_DESC></EQUIPMENT_SHORT_DESC><EQUIPMENT_LONG_DESC></EQUIPMENT_LONG_DESC><SUG_RETAIL_PRICE></SUG_RETAIL_PRICE><DISPLAY_PRICE></DISPLAY_PRICE><EQUIPMENT_PRICE></EQUIPMENT_PRICE><NUMERIC_COST></NUMERIC_COST><REBATE_AMOUNT></REBATE_AMOUNT><PRICE_AFTER_REBATE></PRICE_AFTER_REBATE><REBATE_DESC></REBATE_DESC><EQUIPMENT_IMAGEFILE_SMALL></EQUIPMENT_IMAGEFILE_SMALL><EQUIPMENT_IMAGEFILE_MEDIUM></EQUIPMENT_IMAGEFILE_MEDIUM><EQUIPMENT_IMAGEFILE_LARGE></EQUIPMENT_IMAGEFILE_LARGE><MANUFACTURER_LOGO></MANUFACTURER_LOGO><PRODUCT_LINK></PRODUCT_LINK><UPC></UPC><COMPATIBLE_ACCESSORIES_PAGEURL></COMPATIBLE_ACCESSORIES_PAGEURL><IS_BELOW_IMAP></IS_BELOW_IMAP></ACCESS></TABLENAME></STATEMENT_STORE_SIMPLEXITY_FEED><STATEMENT_STORE_FEED_REFRESH_DATE><TABLENAME ACTION="UPDATE"><TABLE>STORE_FEED_REFRESH_DATE</TABLE><ACCESS><REFRESH_FEED>YES</REFRESH_FEED><REFRESH_CACHE>YES</REFRESH_CACHE><EXTRACT_DATE>2010/10/06</EXTRACT_DATE><FEED_TYPE>SFeed</FEED_TYPE></ACCESS></TABLENAME></STATEMENT_STORE_FEED_REFRESH_DATE></ns0:MT_ProdCatalog_Simplexity> 

Former Member
0 Kudos

Where is the second place i have to use "remove context"

Former Member
0 Kudos

Hi,

One small correction, use removeContext only in between Target element & ifWithoutElse function.

I tried in my system, this mapping is working.

-Supriya.

Former Member
0 Kudos

Do i need to implement this in root node ?

Former Member
0 Kudos

Implement it on the 'access'' node.

-Supriya.

Former Member
0 Kudos

Supriya,

Let me try and update you.

Former Member
0 Kudos

If i need to implement this same logic to another field "Purchase Mode".. how to do ?

Since we have already mapped Purchase id field to access node.

Former Member
0 Kudos

I didn't understand your requirement.

Depending on the 'Purchase ID', you have to generate the access node.

Can you explain little more about the target field of Purchase Mode?

-Supriya.

Former Member
0 Kudos

Hi Supriya,

When i tried to implement this logic in my system i am getting the following error :

I used removecontext only in target field. I have not used removeconext when we map to access node

Error :

Compilation of MM_Simplexity_ProdCatalog successful Cannot create target element /ns0:MT_ProdCatalog_Simplexity/STATEMENT_STORE_SIMPLEXITY_FEED[2]/TABLENAME/ACCESS. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD

Former Member
0 Kudos

Supriya,

Right now i am trying to implement only for field purchase id. I am encouting the error

Former Member
0 Kudos

Any updates...

Former Member
0 Kudos

Hi,

Use removeContext for access node mapping.

-Supriya.

Former Member
0 Kudos

Supriya,

It is not working.

I used remove context only for Access node mapping. I have not used remove context for Purchase id.

I dif mapping as follows for access node.

purchase id -


> Fixvalues---->equalS-->Not -


>ifwithoutelse -
>Removecontext-->Access

constant purchase id

Please guide me

Former Member
0 Kudos

I am not getting Purchase id values for seconde node of records.

Former Member
0 Kudos

Thank you supriya for your efforts.

i wrote one udf and createif node function to resolve this issue.

Answers (1)

Answers (1)

Former Member
0 Kudos

Please Renu PI

I have same problem.

Can share de udf code ?

tks

Marco

Former Member
0 Kudos

UDF Code:

Pass argument : fvalue

choose : All values of context

for(int i=0;i<fvalue.length;i++)

if (fvalue<i> == 100 || fvalue<i> == 101 || fvalue<i> == 102 || fvalue<i> == 103 || fvalue<i> == 104 || fvalue<i> == 105 )

{

result.addValue("true");

}

else

{

result.addValue("false");

}