I spent several frustrating hours try to calculate the percentage of jobs with configured parts by month. I have a BAQ with three sub-queries:
- One sub-qUpgradinuery gets the total number of jobs (calc-total-job-count).
- The second sub-query gets the total number of jobs with configured parts (calc-config-job-count).
- The third sub-query is the top-level and joins the above sub-queries.
In the top-level sub-query I tired to do the following calculation in order to get the percentage of configured jobs:
Calc-config-job-count / calc-total-job-count
The result was zero. I found out that this is because my count variables are integers.
After I changed my calculation as shown below, I got a computed average. I had to convert the integers to decimal variables.
convert(decimal,ConfiguredJobs.Calculated_ConfigJobCount) / convert(decimal,AllJobsTotal.Calculated_AllJobsCount) * 100