Re: Movie Oscars database

darek.dorozinski wrote:

Hello Dimitry ...
I still need your help! I am looking in the code of my script and I can not find where the number code is Categories: in TableGrid2.

It's not script, number of categories from setting of button8


darek.dorozinski wrote:

I would also like to display the sum of all prizes won, as on the attached screenshot.

Please help ...
Regards Darek

Change procedure Form1_TableGrid2_OnChange in this way:

procedure Form1_TableGrid2_OnChange (Sender: TObject);
var
    i: integer;
    n: integer;
begin
  // The following assigns a color to hearders and footers for Tablegrid2
  Form1.Tablegrid2.Columns[0].Header.Color := $002C8BBA;
  Form1.Tablegrid2.Columns[1].Header.Color := $002C8BBA;
  Form1.Tablegrid2.Columns[2].Header.Color := $002C8BBA;
  Form1.Tablegrid2.Columns[3].Header.Color := $002C8BBA;
  Form1.Tablegrid2.Columns[4].Header.Color := $002C8BBA;
  Form1.Tablegrid2.Columns[0].Footer.Color := $002C8BBA;
  Form1.Tablegrid2.Columns[1].Footer.Color := $002C8BBA;
  Form1.Tablegrid2.Columns[2].Footer.Color := $002C8BBA;
  Form1.Tablegrid2.Columns[3].Footer.Color := $002C8BBA;
  Form1.Tablegrid2.Columns[4].Footer.Color := $002C8BBA;

  n := 0;
  for i := 0 to Form1.TableGrid2.RowCount-1 do
  begin
      if Form1.TableGrid2.Cell[4,i].AsInteger = 1 then Inc(n);
  end;

  Form1.TableGrid2.Columns[4].Footer.Caption := IntToStr(n);
end;
Dmitry.

Re: Movie Oscars database

Hello Dimitry ...
I understand now!
Thank you once again.

greetings
Darek

Re: Movie Oscars database

Hello, after the break, friends ...

I'm still working on my project for the Oscars' base.
I'm working on more statistics.
Therefore, I have a request for help:

1.How to display all statistics in one frmStatistics window?
2.How do you hide or otherwise display statistics so that the deleted columns are not visible?

I showed everything on the screenshot attached to the archive !

I am asking for help and thank you in advance for your time!


greetings

Darek

Post's attachments

Attachment icon oscars7.zip 1.28 mb, 8 downloads since 2019-06-22 

Re: Movie Oscars database

Hi Darek,
Instead of having a lot of discrete buttons to show specific statistics, I wonder if it might be easier to have a more 'general' procedure.
In my example (on the frmstatmenu form), I can choose a category and see a summary of nominees and winners (sorted by the most nominations / winners).
Perhaps this can address the sort of  'who has been nominated more than 4 times as supporting actress?' etc etc sort of queries?
Maybe this helps.
Derek
(I had to comment some of your code out before I could get it to run on my PC).

Post's attachments

Attachment icon oscars7.zip 1.12 mb, 16 downloads since 2019-06-22 

Re: Movie Oscars database

Hello derek ...

As always thank you very much for your quick response and professional help ...
Your way of presenting statistics is interesting and worth your attention.
But in spite of everything I would like them to work from the buttons of my menu and show up in one form in one TableGrid. Is it possible at all?
If so, please show me how it should be done? I will be very grateful for any tips.

greetings
Darek

Re: Movie Oscars database

Hello derek ...

I am trying to apply your method of presenting statistics and I am still missing in the winners window to also show movie titles separated by commas. Is it possible? Please, help.

Regards
Darek

Post's attachments

Attachment icon screen15.jpg 137.49 kb, 2 downloads since 2019-06-24 

Re: Movie Oscars database

Hi,
I don't think I'd do it that way (movie titles separated by commas) - the user could end up having to scroll left and scroll right quite a lot. 
Instead, I think I would use a linked tablegrid - the first tablegrid shows the winners summarised by the number of winning nominations for the selected category and the second tablegrid lists the individual films.
This has the added benefit that you can then click on one of the film and then be taken back to Form1 to see all the other nominations for that film.  For example, select 'Best Actor' as your category, then select 'Jack Nicholson'.  The linked grid will show you the two films he won awards for.  Then click on 'One Flew Over The Cuckoo's Nest' and it goes to Form1 (automatically taking the film title as a parameter) to show you all the categories that the film was nominated for (9).
In this way, your statistics and your queries can start to be more integrated.
Derek.

Post's attachments

Attachment icon oscars7.zip 1.12 mb, 19 downloads since 2019-06-24 

Re: Movie Oscars database

Hello derek ...

Bingo !!!

This is what I needed!

The perfect solution. From yesterday, I try to figure out how you did it and I can not understand it :-(
Write to me and show step by step how to make another example, eg I choose a nominated actor from the combobox and I know how much and for what he received nomination and accolades ??? I would like to understand the principle of your solution with a double table.

Thank you very much for your time, I would stay in your place without

Darek

Re: Movie Oscars database

Hello, forum members ...

Despite the holidays, I'm still testing the MVD capabilities in my Oscars base project The last solution of the derek has helped me a lot, but unfortunately I do not understand how it works :-( I do not know MVD enough yet :-(

I would also like to use the TreeView in my project I only managed to display the data but I do not know how to group them for years. I choose a year, a movie and in the window next to me I have all nominations for a given film (see screen in the archive) But the program runs for a long time. Probably by a large number of records? I also do not know how to search the TreeView object table? How to show the content of the Category table in the chart? Maybe some of you will help me? Thank you in advance and I wish you all a great holiday
Darek

Post's attachments

Attachment icon oscars7_fix_derek.zip 1.44 mb, 18 downloads since 2019-06-27 

60 (edited by derek 2019-06-29 20:35:04)

Re: Movie Oscars database

Hi Darek,
I was having a look at your project again.
It seems like users could ask almost any combination of things so I tried to come up with a solution that makes it as flexible as possible (I changed the layout a bit to try and get most things to fit and work off Form1, but it's just cosmetic).
What I've done is basically as follows:
1.  Form1 was taking too long to load because of the calculations it was performing.  So I have taken those off and just left some basic statistics (how many films, how many categories etc) and to save space, I run these at the bottom of the scree on a 'screen ticker'.
2.  Form1 now has filters that enable you to search both films and nominations.  So if, for example, you need to see films with the word 'green' in the title made between 1990 and 2019 with between 4-6 nomination and more than 3 winners etc etc you can.  You can do the same sort of things with nominations.  Depending on what you want, you can just click in a cell on the nominations grid to copy that cell value as the filter (but you can, of course, also type filters in).
3.  All of your options are now put on a 'menu' button to tidy up the screen.
4.  On the 'menu' button', the 'summary' gives you breakdowns by category;  rather than have discrete buttons for the 'top 3', 'top10', top '20' etc, you now just enter the number you want to see and select a category - this then shows both nominations and winners for your selection.  Click on any row and it will break it down into the individual films that were nominated.  Click on an individual film and you switch to Form1 with that selected film as your filter.
The script is a bit muddled (as always happens when you're developing and adding new things in as you think of them, but it can be tidied up when you're finished).
Personally, I wouldn't bother with TreeView - the options for sorting, searching and filtering are limited.
It's too large to attach so here's a link to download from - https://app.box.com/s/y7s86yvqplkoxyvfzev62v1h3p8e7oml
Hope some of this helps move things along.
Derek.

Re: Movie Oscars database

Hello derek ..

You can always count on you as usual !!! :-)

Thank you very much for your help. All your suggestions are what I was looking for. Now I'm working on making your changes in my project. I have a few more questions, but I'll talk to you as I change my base. Once again, many thanks.

Successful holiday
Darek