I need to enable the user to select the filters on Type, Category, Transaction, and Date and based on the selections, I need to check if the subsequent fields have '1' in the values. After that, I need to sum them up and find the average by number of fields.
For example, if the user selects Type - ABC, Category - Credit, Transaction - Deposit , Date - 9/23/2018, I need to count how many fields have '1' in them and find the average as below.
5 (1 for Bank, 1 for In Date, 1 for Out Date, 1 for Pattern and 1 for Description) / 5 (Since there are 5 fields) =1
If the user selects none, it should count number of '1's in all the 5 fields divided by number of fields, which is 5.