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>
SCROLLHORIZONTALLY works:- The first
NAME(COLUMNREFERENCE="A") is the ledger name. - The second
NAMEstarts at Column B and carriesSCROLLHORIZONTALLY. Its formula=Len(trim(B$1))>0checks 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, …). - In this sheet the headings run up to
alias-12(Column M); the empty Column N ends the scroll.
- Only the heading decides when
SCROLLHORIZONTALLYstops. 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 oneNAMEtag per alias column. PARENTsets the group the ledgers are created under (hereSundry 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
- Start Tally Prime and open the company you want to import into.
- Minimize Tally (leave it running).
- Start udiMagic and select
Excel to Tally. - Select option
Masters. - 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.
- Follow the wizard to complete the import.
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