Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Top N Values by category and date

Hi Experts, 

 

I have a huge dataset coming from a database which is in production.

 

I need to show a Data Card which show the "Hospital Name" with most transactions any day.

 

  1. 1 table has the transaction log (I am counting the rows in this table). I need only 1 type of transaction which is a very simple "Basic Filtering job". the same table also has the date for each transaction.
  2. I grouped the count of transactions per day (to get rid of having so many entries in a day, because it is a timestamp, so every second has a transaction row). Now every day has a number of transactions.
  3. 1 table has the hospital names (transactions are mapped against hospitals).

 

For example

Hospital A transacted 200 on 1/1/2020, 250 on 1/2/2020, 251 on 1/3/2020 and 84 on 1/4/2020 (the dates go on for 6 months). 

Hospital B transacted 205 on 1/1/2020, 255 on 1/2/2020, 258 on 1/3/2020 and 184 on 1/4/2020.

Hospital C transacted 210 on 1/1/2020, 259 on 1/2/2020, 94 on 1/3/2020 and 384 on 1/4/2020.

So on.....

 

I want to show a data card that shows (384) which is the highest transaction ever done by any hospital on any day EVER.

I want to show a data card that shows (Hospital C) which is the highest transacting hospital among all hospitals on any day EVER.

 

Offcourse the data is coming every day, so I need to visual to be dynamic so that every day there is a new winner. 

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-easonf-msft ,

       

      The formula you made would also work if the hospital names are in a separate table and the transactions with their dates are in a separate table?

       

      Regards

      • v-easonf-msft's avatar
        v-easonf-msft
        Icon for Community Support rankCommunity Support

        Hi , Anonymous 
        This is just a demo, and I don't know if it will help your actual situation.

        If it doesn't meet your requirement, please kindly share your sample data and expected result if you don't have any Confidential Information.

        Best Regards,
        Community Support Team _ Eason