Data completeness reporting


#1

Hello, folks.

Pimcore is an amazing tool, but I can find any Data Completeness reports. I’m using 5.x OSS version.
This is what I try to archieve: I have like 10 mandatory fields for Product class and would like to see the competeness % for Product. Like

Product data is 65% complete.

I mean not just one Product, but all Products that are available in my system.
Also it would be nice to have a list of objects which are incomplete.

Please, let me know if that is possible.
Thanks!


#2

Hi,
I achieved this using a calculated field (tho I don’t know if this is the best way to deal with it).

Alessandro


#3

Could you tell a bit more about how it works? It only shows on product view screen or I can have a reports as well?


#4

Hi,
You can use a calculated field to compute the data you need in order to build your report.
Like:

Blockquote
public static function compute($object, $context) {
if ($context->getFieldname() == “datacompleteness”) {
$dataCompleteness = 0;
//YOUR LOGIC
return $dataCompleteness;
}
}

Calculated field values are stored in the object_query_N table so you can then write a query to build your custom report (https://pimcore.com/docs/5.x/Development_Documentation/Objects/Object_Classes/Data_Types/Calculated_Value_Type.html, https://pimcore.com/docs/5.x/Development_Documentation/Tools_and_Features/Custom_Reports.html).

N.B.: for some simple cases you can directly write a query which returns the data you need for your custom report without using a calculated field.

Alessandro


#5

also have a look at the advanced demo:



image