Topic: Questions about Counting and Maps

Hello...

I have a question ... can this be done?

I have a table where I store the data of a person (name, surname, home address (text, latitude and longitude), region), in another table the name of the regions belonging to a country (Example: Japan).

- I want to show in a grid (region, people count) how many people belong to each region.
- I want to locate the particular address of each person on the map (limit the use of the map to the country). Can a map be used offline?

2 (edited by derek 2018-01-24 20:26:00)

Re: Questions about Counting and Maps

Hello Wen,
To answer the first part of  your question, the easiest way (I believe) to show counts by region (by country, by anything!) is to use calculated fields.
Please see the attached (an old project that I quickly altered to be more relevant to what you're after).
But, as always with MVD, there are many different approaches that you could take.
Regards,
Derek

Post's attachments

Attachment icon wenregions.zip 341.06 kb, 431 downloads since 2018-01-24 

Re: Questions about Counting and Maps

Hello derek ...
You supplied my first question, and I like the part of opening the location in the browser.
Now, about the second question, do you have any ideas?

Re: Questions about Counting and Maps

Hello again derek ...
Supporting me of the example that you gave me, I tried to add a pie chart where I can show the countries and the quantity per country, but it gives me an error and I do not know how to solve it ..., any ideas ??

Below I attach the version that includes graphics.

Post's attachments

Attachment icon wenregions_graphics.zip 340.26 kb, 409 downloads since 2018-01-25 

Re: Questions about Counting and Maps

I had some time to look at your project. See attached for fix. One thing to understand, calculated fields are NOT real database table fields. They are primarily used in MVD for things like tablegrid columns. You cannot use them in SQL SELECT statements because they are not actual fields. Therefore whenever you need to construct an SQLQUERY you need to basically replicate the calculated field statement inside the SELECT of the Query.

Post's attachments

Attachment icon wenregions_graphics_Fixed.zip 587.52 kb, 437 downloads since 2018-01-26 

Re: Questions about Counting and Maps

Morning Wen, EHW,
EHW - I've never looked at any of the charting options before so you saved me having to scratch my head over this one - very nice!
Wen - one thing you might consider is automatically updating the pie-chart rather than doing it on the button (see attached).  But it's just a cosmetic thing, the real work has already been done by EHW and yourself.
Derek.

Post's attachments

Attachment icon wenregions_graphics_Fixed and auto update.zip 343.62 kb, 441 downloads since 2018-01-26 

Re: Questions about Counting and Maps

Hello EHW, Derek

EHW: A million thanks for that fact, I was really going crazy with that mistake. Very good for you, thank you brother.
Derek: Really very useful auto update, I think that way you look more professional work. Thanks to both of you, they saved me a lot of time.

Now..., any ideas about the second question I put in my first comment ...
Wenchester.

Re: Questions about Counting and Maps

derek wrote:

Morning Wen, EHW,
EHW - I've never looked at any of the charting options before so you saved me having to scratch my head over this one - very nice!
Wen - one thing you might consider is automatically updating the pie-chart rather than doing it on the button (see attached).  But it's just a cosmetic thing, the real work has already been done by EHW and yourself.
Derek.

just one thing
I can show this count in a label, that is, one label per country, (Example: frmMain.label_spain.Caption: = SQL code)

Re: Questions about Counting and Maps

Hello
In the graphic, how to do not show the countries that have not registered a person

10 (edited by derek 2018-01-30 18:29:10)

Re: Questions about Counting and Maps

Hi Wen,
I guessed that you'd want to not show countries that have not registered a person - LOL!
        if (ValidInt(cfcountryValue)) and (cfcountryvalue > '0') then ChartPie.Series[0].AddY(StrToInt(cfcountryValue),countryvalue);
Please see attachment and hope it helps
Regards,
Derek.

Post's attachments

Attachment icon wenregions_graphics_Fixed and auto update.zip 343.69 kb, 444 downloads since 2018-01-30 

Re: Questions about Counting and Maps

derek wrote:

Hi Wen,
I guessed that you'd want to not show countries that have not registered a person - LOL!
        if (ValidInt(cfcountryValue)) and (cfcountryvalue > '0') then ChartPie.Series[0].AddY(StrToInt(cfcountryValue),countryvalue);
Please see attachment and hope it helps
Regards,
Derek.

Hello, Derek.
How easy it is when everyone cooperates ...
That's what I was looking for. Thank you...

I really must have problems with the graphics, look at what I'm doing. It's a horizontal bar graph, the data is fine but it does not really represent the data I want ... What could be the error?

Post's attachments

Attachment icon barChartHorizontal.rar 295.61 kb, 420 downloads since 2018-02-01 

12 (edited by derek 2018-02-03 14:08:50)

Re: Questions about Counting and Maps

Hi Wen,
Please have a look at the attached.
Hope this helps,
Regards,
Derek.

Post's attachments

Attachment icon derek horizontal barchart.zip 340.21 kb, 471 downloads since 2018-02-03 

Re: Questions about Counting and Maps

Hello Derek ...
Thanks for teaching us so much, hehe, I saw that it was just a variable problem, what a fool I am, haha ..

Thanks brother.