Jump to content

Reporting on Measures - Data seems to hold multiple duplicate rows


Recommended Posts

Whilst trying to diagnose some discrepancies between the number of rows returned via a measure and a report, I though I would try running a report on the saved columns held with the measure by using the 'Measure' source option in the report designer. However the output is not quite what I was expecting. The measure in question captures the data ranging column (example below is date_logged - h_datelogged) as the second column value, so entering the same  period as the measure  sample into the report, I get between 3 to 4 times as many rows returned with duplicate rows, but not necessarily identical.
image.thumb.png.e235adbf5595b7e64e8f7c68edd634c0.png

It appears the measure data structure is not quite I was expecting, which was one row for each request that was counted in the measure that meet the criteria. I have been trying to work out what logic or structure it is using but I am stumped. :(

Anyone else tried reporting on measure entities and worked out what it is doing?

Cheers

Martyn
 

Link to comment
Share on other sites

  • 2 weeks later...

Hi Martyn,

It records rows per measure sample instance. Each time measure runs it record additional data per row used to calc that sample. If your measure runs once a day you will have 7 sets of additional row data per sampled record.

It none of the additional column values you are recording have changed over that 7 days then they will look like duplicates records but they are not. They are just a snapshot of that data at the time the sample was taken. 

So lets say call F000001 is active on monday.... measure runs and records a sample row. On Tuesday the measure runs again and F000001 is still active and so is included in sample and another sample row is created. Over the period of 7 days F000001 is always active and so is included in each sample execution. This means you can expect to see 7 rows in the h_data_sampledata table for  F000001 for that 7 day period....the additional data fields capture may or may not be the same depending on if that actual data changed in the record during the sample periods.


Cheers

Link to comment
Share on other sites

@NeilWJ

Thanks for the clarification, however how do we retrieve the specific records which are relating to each sample, in your example how do I report on rows in Mondays sample only?

Also given my measures are measuring request logged or requests closed in the sample period, in our case monthly, they should only appear in one sample?

Cheers

Martyn

Link to comment
Share on other sites

Hi Martyn,

So it should be a join between "h_data_samples" and "h_data_sampledata" ... in your db query tool try query like below (obv change out values for your ones) and see if it gives you duplicates...if it does then the measures service is doing something wrong when storing the data..

select h_data_sampledata.* FROM h_data_measures INNER JOIN h_data_samples ON h_data_measures.h_id = h_data_samples.h_fk_measure_id
INNER JOIN h_data_sampledata ON h_data_samples.h_id = h_data_sampledata.h_fk_sample_id
WHERE h_data_measures.h_title = 'Total Incidents Logged by Source - Monthly'
AND h_data_samples.h_sample_date between '2010-01-01 00:00:00' and '2019-12-31 23:59:59'


Cheers

Link to comment
Share on other sites

@NeilWJ

I will give that a go and let you know.

In terms of using a report on a measure, I presume by selecting the measure from the drop down would select the correct measure, so the report would only need to select on the h_sample_date field to equate to your SQL above?

Cheers

Martyn

Link to comment
Share on other sites

  • 2 weeks later...

@NeilWJ

I have used your query to get the count of records in the sample source to compare it to the measure count, however though I no longer have duplicates it highlights the discrepancies between the number of rows returned by the query and the number displayed on the measure. 

 

Query returns 461 rows, which is what I believe is correct and the measure shows 268, which is wrong and too low.

image.thumb.png.d49636506572292f8910f90943e3b33a.png

image.thumb.png.6ad09a8fd1acf112dfbd3e71115f3d5d.png

The discrepancies are logged with Hornbill Support under IN00156006.

Cheers

Martyn

 

Link to comment
Share on other sites

@NeilWJ

Now taking you SQL and attempting to map this to a Report on a Measure just using the same criteria as the SQL

image.thumb.png.2f8b8fbec0f1a70d151684d8c7ff2035.png

Selecting all columns and then the same sample period.

image.thumb.png.2a5dca583920ac01b8e5742ad466c82e.png

The results is very large csv with 10,135 rows, with blank rows and results from different measures.

image.png.5664ab0e188eaef9300aa037cd249a2f.png

It appears that even though you select a measure on the General tab it is not applied.

Attempting to put this in manual is not possible as the Filter option for Measure Sample does not list any columns.
image.thumb.png.6e4c4efc92bd4e009d67c0e937a2b761.png
 

There appear to be a couple of Bugs in the reporting on measures component?

Cheers

Martyn

 

Link to comment
Share on other sites

  • 2 weeks later...

@Martyn Houghton,

So took a look at the reporting and believe i have addressed reporting side. Going to have a run through it with dean on monday...i will send you the sql it generates so you can try it in db tool just to see difference. With insights next week i wont be able to push this to live until after that and that said hope to see you there on wednesday.

Cheers

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...