Recent content by crashboat

  1. C

    Calculate Median value for group of transactions within the same industry

    You are brilliant! Thank you very much. It works beautifully. I liked how you simplified the function call from the query to pass the 4 variables. I also noticed in the function MedianF you included a line .percentposition = .5 to get to the middle record in the dataset (I assume). I appreciate...
  2. C

    Calculate Median value for group of transactions within the same industry

    Thanks again. I have some good and bad news. But I truly think we are getting closer to the end. Apologies as after I submitted my last reply I realized I had made a change to one of the modules, hence the reason why I had the empty recordset. After correcting that, the code worked and displayed...
  3. C

    Calculate Median value for group of transactions within the same industry

    Thanks again for your support. I made the changes as you indicated, except for the first query, since the field needed to be passed to determine the median does not exist in the table tbl_Data_Main. That is a calculated field created in qry_KPIs_By_Company. In addition, I simplified the query as...
  4. C

    Calculate Median value for group of transactions within the same industry

    I understand and it is true. This is a bad database. However, if I normalize it, I still have to pass the values for all the companies within an industry to calculate the industry median. That was my original request as I could not get that to work. Any other ideas?
  5. C

    Calculate Median value for group of transactions within the same industry

    You are absolutely correct. This db is not normalized at all. Not an excuse, but it was an urgent request and need to provide a quick solution. I will make the Company number (Excel_ID) my primary key as that is unique. Luckily the number of months is not going to increase as they plan to carry...
  6. C

    Calculate Median value for group of transactions within the same industry

    Thank you so much for explaining the difference between passing a field name or a value of the field. Excellent! However, I don't understand why wouldn't we want to pass the value for both fields.? I see how having the IIF inside the function can clean it up a bit, but I still have to test...
  7. C

    Calculate Median value for group of transactions within the same industry

    Thanks again. You are absolutely correct. I am calling the median function from a query as I ultimately need to see the median by industry in the query output so I can use this to perform other calculations. I don't understand the 3rd bullet on your last reply. What literal quote are your...
  8. C

    Calculate Median value for group of transactions within the same industry

    Thank you very much lagbolt for your reply. I understand I never used the pgroup parameter in my code as that is the part I am not clear with. I thought I needed build something like a Do While loop to get all the transactions for an industry, calculate the Median and then move on to the next...
  9. C

    Calculate Median value for group of transactions within the same industry

    I am using the code below to evaluate values for each transaction to determine the median: Function MedianF(pTable As String, pfield As String, pgroup As String) As Single '******************************************* 'Purpose: Return median value from a recordset 'Inputs: ? medianF("Values"...
  10. C

    Hello from Nottingham, UK

    Welcome! I just joined today and excited to see how this site works.
  11. C

    Hello!

    Hello Everybody, I split my time between Puerto Rico and Washington DC Area. I have been using Access for years and I love to develop databases that help with my job. Ever since I started using Access I liked it a lot. I am mostly self-trained and still have a lot to learn. I also like jogging...
Back
Top Bottom