Example using the Enumeration Task to create meaningful text from numeric codes.
The Enum Task is in the toolbox of ETL Studio and allows you to design and create lookup tables that makes codes (like 0,1,2) turn into meaning full text.
Below is a very small project for download and a sample of the code that is generated when you use the Enum Task (which is non-code based and comes with a nice user interface.
Download: Enum exaxmple.improj
Script:
IMPORT[tAccountGroup]= me.{SELECT0as[ID],'Income Statement'as[Value]UNIONALLSELECT1,'Balance Sheet'}
IMPORT[tOpportunityEntryActive]= me.{SELECT1as[ID],'Active'as[Value]UNIONALLSELECT2,'Inactive'}
IMPORT[tItemEntryType]= me.{SELECT0as[ID],'Purchase'as[Value]UNIONALLSELECT1,'Sale'UNIONALLSELECT2,'Positive Adjustment'UNIONALLSELECT3,'Negative Adjustment'UNIONALLSELECT4,'Transfer'UNIONALLSELECT5,'Consumption'UNIONALLSELECT6,'Output'}
IMPORT[tCreditLimit]= me.{SELECT1as[ID],'With Credit Limit'as[Value]UNIONALLSELECT2,'Without Credit Limit'}
IMPORT[tItemAssetType]= me.{SELECT2as[ID],'Item'as[Value]UNIONALLSELECT4,'Fixed Asset'}
IMPORT[tValueEntryType]= me.{SELECT0as[ID],'Direct Cost'as[Value]UNIONALLSELECT1,'Revaluation'UNIONALLSELECT2,'Rounding'UNIONALLSELECT3,'Indirect Cost'UNIONALLSELECT4,'Variance'}
IMPORT[tPostingDateClosing]= me.{SELECT0as[ID],'Exclude Closing Entries'as[Value]UNIONALLSELECT1,'Closing Entries only'}
IMPORT[tItemEntryMainType]= me.{SELECT0as[ID],'Decreases'as[Value]UNIONALLSELECT1,'Increases'}
IMPORT[wdInventoryValuationMethod]= me.{SELECT0as[ID],'Invoiced'as[Value]UNIONALLSELECT1,'Include expected cost'UNIONALLSELECT2,'Posted to G/L'}
IMPORT[wdShiptotype]= me.{SELECT0as[ID],'Primary Address'as[Value]UNIONALLSELECT1,'Alternate Address'}
IMPORT[wdOpportunityStatus]= me.{SELECT0as[ID],'Not Started'as[Value]UNIONALLSELECT1,'In Progress'UNIONALLSELECT2,'Won'UNIONALLSELECT3,'Lost'}
IMPORT[wdOpportunityClosed]= me.{SELECT1as[ID],'Yes'as[Value]UNIONALLSELECT0,'No'}
IMPORT[wdAgingBucket]= me.{SELECT0as[ID],'Not Due / On Time'as[Value]UNIONALLSELECT30,'0-30 Days'UNIONALLSELECT60,'0-60 Days'UNIONALLSELECT90,'0-90 Days'UNIONALLSELECT120,'Over 90 Days'}
IMPORT[wdJournalDocumentType]= me.{SELECT-1as[ID],'General Ledger Entry'as[Value]UNIONALLSELECT1,'Payment'UNIONALLSELECT2,'Invoice'UNIONALLSELECT3,'Credit Memo'UNIONALLSELECT4,'Finance Charge Memo'UNIONALLSELECT5,'Reminder'UNIONALLSELECT6,'Refund'}
IMPORT[wdJobStatus]= me.{SELECT0as[ID],'Planning'as[Value]UNIONALLSELECT1,'Quote'UNIONALLSELECT2,'Order'UNIONALLSELECT3,'Completed'}
IMPORT[wdItemResourceType]= me.{SELECT1as[ID],'Account (G/L)'as[Text]UNIONALLSELECT2,'Item'UNIONALLSELECT3,'Resource'UNIONALLSELECT4,'Fixed Asset'UNIONALLSELECT5,'Charge Item'}
IMPORT[wdGLSourceType]= me.{SELECT0as[ID],'Ledger Entry'as[Value]UNIONALLSELECT1,'Customer'UNIONALLSELECT2,'Vendor'UNIONALLSELECT3,'Bank Account'UNIONALLSELECT4,'Fixed Asset'}
IMPORT[wdOpportunityPriority]= me.{SELECT0as[ID],'Low'as[Text]UNIONALLSELECT1,'Normal'UNIONALLSELECT2,'High'}
Comments
Please sign in to leave a comment.