It is necessary to process many many rows of the table, filtering them by columns. Perhaps I'll start immediately with an example.
Example of columns (filters): Имя-Фамилия-Возраст-Зачет(1-зачет,0-не зачет)
Sample data (strings):
Иван Иванов 20 1 Петр Петров 23 0 Иван Петров 23 1 Петр Иванов 21 0 PS row is divided into arrays of columns, that is, a separate array of names, surnames of age and result, as well as the corresponding arrays with options.
Иван, Петр, Иван, Петр - column array
Иван, Петр - an array of column options
Now, I need to display the number of credits and non credits for all filter options. Example: Иван 2 0 - with a filter in the name "Иван" 2 зачет и 0 не зачет
Петров 1 1 - with a filter on the name "Петров" 1 зачет и 1 не зачет .
And so you need to display the result for each filter. In this case there will be 12 filter options. Some of them: "Иван" ; "Петр" ; "Иван" and 20 (age); "Петров" and 23 , etc.
So far I have only one idea - to make several nested loops and in the last one shove 12 if , which of course is very dreary, because in fact I have more filters and values, I don’t really want to prescribe 64 if .
UPD I understand that this can be solved through С++ or SQL , but I work in Pascal, and it seems to me that this is not real, I have found similar tasks like Example 1 and Example2 , I still don’t rummage in C, somebody could explain the solution?
UPD2 That's what's in reality. You need to find all kinds of filter combinations and pass to them. For example, the filter is 51% in the first column, the number of проходов (1) = 1. And so I need to find for all combinations, for example - 51% in the first column and 23% ; 25% in the third column and a forecast of 12 and so on. Now I can find all this separately, that is, I can process only 1 variant of the combination. I pound the data of the Проц1 and Проход columns into the program and then compare it with percentages from 1 to 100, and for each from 1 to 100 the number of Проходов 1 and 0 comes out. 