Exercise 4

Import Stock Item Masters with Standard Cost Price

Published


This exercise imports Stock Item masters along with a history of Standard Cost and Standard Selling Price changes — each item can have several rate-change rows, one per effective date. Because a single item's data now spans multiple Excel rows, this exercise introduces COLUMNNAME.LIST and the SCROLL attribute, which together tell udiMagic to keep reading extra rows as more history for the same item instead of starting a new one.

The Excel sheet

Rows 3 and 4 continue BunnyBT1's rate history — the NAME, Alias, Group and Unit columns are left blank on those rows since they only carry a new Cost/Price row for the item started in row 2.

A B C D E F G H I J
1 NAME Alias Under Group Units Standard Cost Applicable from Rate Per Standard Selling Price Applicable from Rate Per
2 BunnyBT1 NUZIVEEDU SEEDS LTD - BUNNY BT1 Seeds Pkt 01.04.2008 750 Pkt 01.04.2008 950 Pkt
3 01.05.2008 775 Pkt 01.05.2008 975 Pkt
4 01.06.2008 800 Pkt 01.06.2008 1000 Pkt
5 BunnyBT2 NUZIVEEDU SEEDS LTD - BUNNY BT2 Seeds Pkt 01.04.2008 750 Pkt 01.04.2008 950 Pkt

Step 1 — Declare the key field with COLUMNNAME.LIST

Whenever SCROLL="Yes" is used, udiMagic needs to know which column identifies "this row belongs to the same item as the row above." COLUMNNAME.LIST declares Column A (NAME) as that key field. The second entry, ID, is a fixed requirement whenever COLUMNNAME.LIST is used alongside SCROLL.

<XMLTAGS xmlns:UDF="TallyUDF" CELLREFERENCE="A1">
<!--  Specifies that the Column A is the key-field.  -->
<COLUMNNAME.LIST>
<COLUMNNAME>NAME</COLUMNNAME>
<!--  This is required as we have used the SCROLL attribute in these XML tags  -->
<COLUMNNAME>ID</COLUMNNAME>
</COLUMNNAME.LIST>

Step 2 — Create the Unit and Stock Group masters

<!--  Create UNIT Masters based on Column D data  -->
<MASTER TYPE="UNIT">
<!--  The UNIT Master does not support Aliases.  -->
<!--  As a result, we must not use the NAME.LIST tag, but directly use the NAME tag  -->
<NAME COLUMNREFERENCE="D"/>
<ISSIMPLEUNIT>Yes</ISSIMPLEUNIT>
</MASTER>
<!--  Create STOCKGROUP Masters  -->
<MASTER TYPE="STOCKGROUP">
<NAME.LIST>
<!--  Fetch the value for NAME tag from Column C of Excel Sheet  -->
<NAME COLUMNREFERENCE="C"/>
</NAME.LIST>
</MASTER>

Step 3 — Create the Stock Item master with its Cost/Price history

STANDARDCOSTLIST.LIST and STANDARDPRICELIST.LIST each use SCROLL="Yes", so udiMagic keeps appending one entry per row — for as many rows as share the same key-field value — instead of stopping after the first row.

<!--  Create STOCKITEM Masters  -->
<MASTER TYPE="STOCKITEM">
<NAME.LIST>
<!--  Fetch the value for NAME tag from Column A of Excel Sheet  -->
<NAME COLUMNREFERENCE="A"/>
<!--  ALIAS to be taken from Column B of Excel Sheet  -->
<NAME COLUMNREFERENCE="B"/>
</NAME.LIST>
<!--  StockGroup Name to be taken from Column C  -->
<PARENT COLUMNREFERENCE="C"/>
<!--  BaseUnits to be taken from Column D  -->
<BASEUNITS COLUMNREFERENCE="D"/>
<!--  Standard Cost details. The SCROLL attribute is used as the data spans to multiple rows  -->
<STANDARDCOSTLIST.LIST SCROLL="Yes">
<DATE COLUMNREFERENCE="E"/>
<RATE FORMULA='=+F# & "/" & +G#'/>
</STANDARDCOSTLIST.LIST>
<!--  Standard Price details.The SCROLL attribute is used as the data spans to multiple rows  -->
<STANDARDPRICELIST.LIST SCROLL="Yes">
<DATE COLUMNREFERENCE="H"/>
<RATE FORMULA='=+I# & "/" & +J#'/>
</STANDARDPRICELIST.LIST>
</MASTER>
</XMLTAGS>
Note:
  1. The NAME.LIST here has two NAME tags — the first (Column A) is the Stock Item's primary name, the second (Column B) becomes its Alias.
  2. SCROLL="Yes" on STANDARDCOSTLIST.LIST / STANDARDPRICELIST.LIST is what lets rows 3 and 4 (with a blank NAME column) add more Cost/Price entries to the same Stock Item instead of being treated as new items — this only works because COLUMNNAME.LIST in Step 1 told udiMagic which column to use to detect "same item."
  3. Tally's RATE field for a Standard Cost/Price entry expects a single value like 750/Pkt, not two separate Rate and Per columns. The FORMULA =+F# & "/" & +G# concatenates Column F (Rate) and Column G (Per) with a / in between — for row 2 this becomes =+F2 & "/" & +G2, producing 750/Pkt. See udiMagic XML tags for the full tag/attribute reference.

Step 4 — Import into Tally

  1. Start Tally Prime and open the company you want to import into.
  2. Minimize Tally (leave it running).
  3. Start udiMagic and select Excel to Tally.
  4. Select option Masters.
  5. Browse to select the Excel sheet and the XML tags file.
  6. Follow the wizard to complete the import — each Stock Item is created once, with its full Standard Cost and Standard Selling Price history attached.
Sample files: The sample Excel sheet and matching XML tags file for this exercise will be linked here shortly.

Ready to import your Excel data into Tally?

Download udiMagic and start a 14-day free trial — no credit card required.

Download udiMagic View Pricing