Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying build a table similar to the following. I have everything built except for the Name field which is supposed to be a concatenation of the Type field plus an incremented number. The incremented numbering should reset to 001 on each grouping of Project # & Type.
The question is...How do process the existing table containing Project #, Type, Variable Date and Amount to include the Name field with the incremented numbering scheme?
I'm building this within the script of our data model. This is not being built on the front-end application.
NOTE: This table has no relevant usage within QV. We're trying to build a temporary table for export to .csv format for use in another application.
Try this:
Table:
LOAD Project.ID,
Transaction.Type,
Transaction.Type & ' - ' & Num(AutoNumber(RowNo(), Project.ID&Transaction.Type), '000') as Name,
Transaction.Date,
Transaction.Amount
FROM
Transactions.xlsx
(ooxml, embedded labels, table is sfTransactions);
Please share the data file.
Unfortunately, I cannot share the script because it contains confidential data. Some of it is fairly complex as well.
Basically, the screen shot below is the table that I have built and I need to add the Name column with the incremental numbering (previously shown). So I need to figure out how a load statement, or something else, be written to accomplish this?
All mindaugasbacius and all of us are looking for is an Excel version of the above snapshot. We won't be able to load the image and it would be an hassle to type all this up and load it.
I've attached the Excel file containing the Transactions table that I've built so far.
Appreciate any guidance that can be provided.
Try this:
Table:
LOAD Project.ID,
Transaction.Type,
Transaction.Type & ' - ' & Num(AutoNumber(RowNo(), Project.ID&Transaction.Type), '000') as Name,
Transaction.Date,
Transaction.Amount
FROM
Transactions.xlsx
(ooxml, embedded labels, table is sfTransactions);
Or this if you want the date to be ordered and somehow your data is not ordered by date correctly
Table:
LOAD Project.ID,
Transaction.Type,
Transaction.Date,
Transaction.Amount
FROM
Transactions.xlsx
(ooxml, embedded labels, table is sfTransactions);
FinalTable:
LOAD *,
Transaction.Type & ' - ' & Num(AutoNumber(RowNo(), Project.ID&Transaction.Type), '000') as Name
Resident Table
Order By Project.ID, Transaction.Type, Transaction.Date;
DROP Table Table;
That worked perfectly! Never thought of using the AutoNumber function is that way before.
You're help is sincerely appreciated!