Exercise 14

Import Ledger Masters with Multiple Aliases Using SCROLLHORIZONTALLY

Published


This exercise teaches you the SCROLLHORIZONTALLY attribute. It makes udiMagic keep reading columns one after another, moving to the right, for as long as a condition holds — so a single tag can import any number of aliases per ledger. Here, one NAME tag with SCROLLHORIZONTALLY reads Alias 1, Alias 2, Alias 3 and so on, and stops at the first column that has no heading.

Step 1 — Prepare the Excel sheet

Create an Excel sheet with the ledger name in Column A and the aliases in the columns to its right (here Columns B to M), one ledger per row. Every alias column must have a heading in row 1 — that heading is what SCROLLHORIZONTALLY checks. Leave a cell blank where a ledger has fewer aliases.

A B C D E F G H I J K L M
1 name alias-1 alias-2 alias-3 alias-4 alias-5 alias-6 alias-7 alias-8 alias-9 alias-10 alias-11 alias-12
2 Parimal Arts P-1 P-2 P-3 P-4 P-5 P-6
3 V S Traders V-1 V-2 V-3 V-4 V-5
4 A R S Marketing A-1 A-2 A-3 A-4
5 Vero Beach Embroidery VB-1 VB-2 VB-3

Step 2 — Write the XML tags in a separate file

Open Notepad (or any plain-text editor) and write the following XML tags:

<XMLTAGS xmlns:UDF="TallyUDF" CELLREFERENCE="A1">
    <MASTER TYPE="LEDGER">
        <NAME.LIST>
            <!--  Column A = Ledger Name  -->
            <NAME COLUMNREFERENCE="A"/>
            <!--  SCROLLHORIZONTALLY
                    Keep reading the alias columns (B, C, D, ...) one after another, moving to the right.
                    Stop when a column has no heading
                -->
            <NAME COLUMNREFERENCE="B" SCROLLHORIZONTALLY="=Len(trim(B$1))>0"/>
        </NAME.LIST>
        <!--  Group is fixed here  -->
        <PARENT>Sundry Debtors</PARENT>
        <ISBILLWISEON>Yes</ISBILLWISEON>
        <AFFECTSSTOCK>No</AFFECTSSTOCK>
        <ISCOSTCENTRESON>No</ISCOSTCENTRESON>
    </MASTER>
</XMLTAGS>
How SCROLLHORIZONTALLY works:
  1. The first NAME (COLUMNREFERENCE="A") is the ledger name.
  2. The second NAME starts at Column B and carries SCROLLHORIZONTALLY. Its formula =Len(trim(B$1))>0 checks that the heading in row 1 is not blank. While it is true, udiMagic reads this column as an alias and scrolls one column to the right (C$1, D$1, …).
  3. In this sheet the headings run up to alias-12 (Column M); the empty Column N ends the scroll.
Remarks:
  • Only the heading decides when SCROLLHORIZONTALLY stops. A blank alias cell (such as Alias 4 to Alias 6 of Parimal Arts) is skipped and does not create an empty alias.
  • To support more aliases, just add columns with headings (alias-13, alias-14, …) — the XML does not change. The previous exercise, Ledgers with Multiple Aliases, needed one NAME tag per alias column.
  • PARENT sets the group the ledgers are created under (here Sundry Debtors).
  • Comments are written using the <!-- --> syntax. See udiMagic XML tags for the full tag/attribute reference.

Step 3 — Save the file

Save it as ledger-with-multiple-aliases-using-scrollhorizontally-xml-tags.xml. In the Save as type box, choose All Files — otherwise Notepad appends .txt and you'll end up with ledger-with-multiple-aliases-using-scrollhorizontally-xml-tags.xml.txt instead.

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 both the Excel sheet and the XML tags file — you're prompted for the XML file on the same screen as the Excel sheet.
  6. Follow the wizard to complete the import.
Sample files: Download the sample Excel sheet and matching XML tags file for this exercise. Download ledger-with-multiple-aliases-using-scrollhorizontally.zip

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