Cabinetman Posted September 26, 2008 Posted September 26, 2008 (edited) So I have a really tough time searching in here but know this has come up before......... In short I need to take my - List (field)- and add to it. [color:red]I see some confusion - my fault - edited to help little.. These are items sold and how many each customer bought... not how many of each in the table (sorry) assume it's for a used car dealership: Records table1::buyer , table1::item name and table1::item quantities john smith car 1 helen jones truck 1 james hunt boat 2 (he's rich I guess..LOL) table2::all items as list...I need to calc out to: Item.1=car&Item.1.quantity=1&Item.2=truck&Item.2.quantity=1&Item.3=boat&Item.3.quantity=2 So 2 tables, related, and I'm trying to pull this list as formatted above into the 2nd table.... I started with: Substitute ( List (table::items ) ; ¶ ; then stuck on how to take the substitute and valuecount functions and add what I need..?? maybe??? Help needed.please Edited September 27, 2008 by Guest
Søren Dyhr Posted September 27, 2008 Posted September 27, 2008 (edited) Perhaps if just knew when this is needed, we could get to the core of the problem ... this CF seems to get somewhere in the vicinity of what you're going for: http://www.briandunning.com/cf/890 ...here's another one: http://www.briandunning.com/cf/309 Is it leading anywhere?? --sd Edited September 27, 2008 by Guest
Vaughan Posted September 27, 2008 Posted September 27, 2008 This would much easier to do if the items (car etc) are in a related table, along with a field containing the quantities. In this table you could create a cal field to do the "Item.1=car&Item.1.quantity=1" and use the List() function in the parent table to join them all up.
Cabinetman Posted September 27, 2008 Author Posted September 27, 2008 [color:red]First check the edit at the top.... Is it leading anywhere?? --sd No not really but maybe I can use it.... This would much easier to do if the items (car etc) are in a related table, along with a field containing the quantities. They are... I was already headed that way. In this table you could create a cal field to do the "Item.1=car&Item.1.quantity=1" and use the List() function in the parent table to join them all up. Yes I could but I couldn't figure how to get the #'s to change based on how many records there are in the find request.. I figured using the valuecount and somehow... I don't know! For some reason my mind is just not working like it should today!!
Cabinetman Posted September 27, 2008 Author Posted September 27, 2008 (edited) Dumb... dumb... dumb! And then I found the Get ( RecordNumber ) so...... field 1 calculation: "Item." & table::item list number & "=" & table::item & "& Item." & table::item list number & ".quantity=" & table::quantity field 2 is table::item list number - calculation: Get ( RecordNumber ) Field 3 in related table: Substitute ( List (table::field1) ; ¶ ; "," ) Gave me.......... Item.1=car&Item.1.quantity=1,Item.2=truck&Item.2.quantity=1,Item.3=boat&Item.3.quantity=2 And all is well again in the universe. Thanks guys! I made it harder than it was........... [color:red]Well almost....... Problem: In table 1 field1 calc the found items calc looks fine But in table 2 where I pull the list to if there are 8 total records in table 1 and the found count is 2 and they are the 4th and 7th record.... It puts 4 and 7 in the Get ( RecordNumber ) field in the calc instead of the 1 & 2 in table1. UGH !! Edited September 27, 2008 by Guest
Søren Dyhr Posted September 28, 2008 Posted September 28, 2008 ...but if it's potalized isn't it nessersarily a calc'field required, but just a @@ thrown somewhere in the portalrow! --sd
Cabinetman Posted September 28, 2008 Author Posted September 28, 2008 It's pulled into a calc field for part of a URL in another table. The URL returns an XML doc which is imported. To get around it I created a new field to hold the contents and scripted a set field which is then part of the URL calc field.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now