-
Oct 25th, 2021, 04:30 AM
#1
Thread Starter
Member
2 Dimesnion array with Dynamic Values
Hi
How to create 2 Dimension array dynamically and preserve values. In a database i have Sales Figure , Brand , Year.
Hyundai 2010 10
Hyundai 2011 5
Hyundai 2010 4
Tata 2008 10
Tata 2011 20
Tata 2012 5
I want to display data like below
2008 2010 2011 2012
Hyundai 0 14 5 -
Tata 10 - 20 5
Thanks
-
Oct 25th, 2021, 07:27 AM
#2
Re: 2 Dimesnion array with Dynamic Values
Little vague here...are you saying you want something like this?
Make |
2008 |
2009 |
2010 |
2011 |
2012 |
Hyundai |
0 |
0 |
14 |
5 |
0 |
Tata |
10 |
0 |
0 |
20 |
5 |
A flexgrid is a good control to use to display tabular data.
Last edited by SamOscarBrown; Oct 25th, 2021 at 07:47 AM.
Sam I am (as well as Confused at times).
-
Oct 25th, 2021, 07:55 AM
#3
Thread Starter
Member
Re: 2 Dimesnion array with Dynamic Values
Hi Sam
Yes . FlexGrid is o.k . Can u help with array how it can be done . There can be more records in a data . If there is different year then accordingly that column year should be created
Thanks
-
Oct 25th, 2021, 08:02 AM
#4
Re: 2 Dimesnion array with Dynamic Values
If there is tabular Data in a Database, why in blazes do you want to "preserve" values in an Array?
Sam's Result above is easy to retrieve via SQL, and easy to display in a Grid.
This begs the question: Whatever is the array for?
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Oct 25th, 2021, 08:06 AM
#5
Re: 2 Dimesnion array with Dynamic Values
Yeah, like this:
Sam I am (as well as Confused at times).
-
Oct 25th, 2021, 08:37 AM
#6
Re: 2 Dimesnion array with Dynamic Values
People call me crazy because i'm jumping out of perfectly fine airplanes.
I think they got it right! I've jumped (well, rapelled) out of several helicopters...much saner! :-)
(82nd/101st/or hobbyist?)
Sam I am (as well as Confused at times).
-
Oct 25th, 2021, 09:07 AM
#7
Re: 2 Dimesnion array with Dynamic Values
Originally Posted by SamOscarBrown
I think they got it right! I've jumped (well, rapelled) out of several helicopters...much saner! :-)
(82nd/101st/or hobbyist?)
Hobbyist.
Childhood dream turned into a passion 30 years after my childhood dream.
If you want to take a look:
https://www.dropbox.com/s/bz580aw28b...20Fun.mp4?dl=0
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Oct 25th, 2021, 10:51 AM
#8
Re: 2 Dimesnion array with Dynamic Values
cool....in Deutschland, yah? Sehr wunderschonen. (Sorry about the missing umlaut). Spend 8.5 years there. But not in the air!!!!!!!!!!!!!!!!!!
Sam I am (as well as Confused at times).
-
Oct 28th, 2021, 05:41 AM
#9
Thread Starter
Member
Re: 2 Dimesnion array with Dynamic Values
Hi
How to define an array for below code
Make 2008 2009 2010 2011 2012
Hyundai 0 0 14 5 0
Tata 10 0 0 20 5
Thanks
-
Oct 28th, 2021, 06:10 AM
#10
Fanatic Member
Re: 2 Dimesnion array with Dynamic Values
Ramco:
Is this homework?
In the upper right corner is a search button. If you will type in "2D array" or "dimension 2D" you should get a lot of hits. Looking at your data, you might want a 3D not 2D.
Before you go down this route, realize that ONLY the last dimension of a multi-dimensioned array with PRESERVE can be modified. HTH
-
Oct 28th, 2021, 06:29 AM
#11
Re: 2 Dimesnion array with Dynamic Values
1-What you wrote is NOT 'code'!!!!
2-Do you know anything about arrays?
Sam I am (as well as Confused at times).
-
Oct 28th, 2021, 07:39 AM
#12
Re: 2 Dimesnion array with Dynamic Values
the way you code it depends on where the data is coming from
and what you are going to do with the data after.
How you want to search it etc.
at a minimum I would not use a 2d array. it would be better to use
3 arrays in sync
something like msgbox make(0) & " " & tata(0) would display "2008 10"
I am sure this is still not the way I would code it but we only see a tiny slice
of what you are doing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|