PHPackages                             koolreport/cleandata - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. koolreport/cleandata

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

koolreport/cleandata
====================

Solve the missing data

1.6.1(3y ago)3182.3k↓25.7%MITPHP

Since May 8Pushed 3y ago2 watchersCompare

[ Source](https://github.com/koolreport/cleandata)[ Packagist](https://packagist.org/packages/koolreport/cleandata)[ Docs](https://www.koolreport.com)[ RSS](/packages/koolreport-cleandata/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)DependenciesVersions (10)Used By (0)

Introduction
============

[](#introduction)

Missing data is always a problem with data analysis and data mining. The `cleandata` package give you methods to solve this data missing issue.

Installation
============

[](#installation)

By downloading .zip file
------------------------

[](#by-downloading-zip-file)

1. [Download](https://www.koolreport.com/packages/cleandata)
2. Unzip the zip file
3. Copy the folder `cleandata` into `koolreport` folder so that look like below

```
koolreport
├── core
├── cleandata
```

By composer
-----------

[](#by-composer)

```
composer require koolreport/cleandata

```

Documentation
=============

[](#documentation)

The missing value normally comes to KoolReport in form of `null` value. We solve this by either **drop the row** or **fill new value for it**.

DropNull
--------

[](#dropnull)

The `DropNull` process will drop the row which has `null` value or meet certain number of `null` occurrences.

Let look at an example:

```
$this->src('db')
->query("select * from customers")
->pipe(new DropNull())
->pipe($this->dataStore('clean_data'));

```

Above is simplest example of using `DropNull` process. All the row which has `null` value will be dropped. As a result, return data will be those **customers** with full informations.

### Target a certain columns only

[](#target-a-certain-columns-only)

Sometime you only drop the row if some certain columns has `null` values:

```
->pipe(new DropNull(array(
    "targetColumns"=>array("salary","tax")
)))

```

### Exclude some columns

[](#exclude-some-columns)

If you want to target all columns except some because it is not important, you do:

```
->pipe(new DropNull(array(
    "excludedColumns"=>array("address","city")
)))

```

### Target specific type of columns

[](#target-specific-type-of-columns)

For example, You can target `number` columns only, if any of those columns has `null` value, the row will be dropped:

```
->pipe(new DropNull(array(
    "targetColumnType"=>"number"
)))

```

You can target to other column types which are `string`,`date`,`datetime`,`time`

### Threshold

[](#threshold)

For example, if data row contains more than 2 `null` values, drop the row:

```
->pipe(new DropNull(array(
    "thresh"=>3,
)))

```

### Targeted value

[](#targeted-value)

What if you do not want to drop `null` value but the `0` value. The missing data to you is the `0` value, you can do

```
->pipe(new DropNull(array(
    "targetValue"=>0,
)))

```

Of course, you can set any target values regardless number type or string type. The default value of `targetValue` is `null`.

### Stricly Null

[](#stricly-null)

By default the the `null` could be empty string or `0` value. To enable strict comparison of both value and type, you set the following:

```
->pipe(new DropNull(array(
    "strict"=>true,
)))

```

FillNull
--------

[](#fillnull)

The `FillNull` value is another method of cleaning data. We do not drop row with `null` value, rather we fill `null` value with the new value.

```
->pipe(new FillNull(array(
    "newValue"=>0
)))

```

Above code will fill all the `null` value with `10`.

### Targeted value

[](#targeted-value-1)

What if you want to target at `0` value, you can do:"

```
->pipe(new FillNull(array(
    "targetValue"=>0,
    "newValue"=>10,
)))

```

### Fill missing value with MEDIAN and MEAN

[](#fill-missing-value-with-median-and-mean)

In above example, we fill missing value with the value we want. However the better method is to fill them with mean or median of the column values. This solution seems more elegant. You can do:

```
->pipe(new FillNull(array(
    "newValue"=>FillNull::MEAN,
)))

```

For median, you do

```
->pipe(new FillNull(array(
    "newValue"=>FillNull::MEDIAN,
)))

```

### Target some specific columns

[](#target-some-specific-columns)

You can apply fulling action to some of specified columns:

```
->pipe(new FillNull(array(
    "targetColumns"=>array("salary","tax"),
)))

```

### Exclude some columns

[](#exclude-some-columns-1)

Some columns are not important and missing value does not affect, you can do:

```
->pipe(new FillNull(array(
    "excludedColumns"=>array("lastname","gender"),
)))

```

### Target some specific column type

[](#target-some-specific-column-type)

If you want you can apply the the fill to certain `number` columns:

```
->pipe(new FillNull(array(
    "targetColumnType"=>"number"
)))

```

### Strictly Null

[](#strictly-null)

By default the the `null` could be empty string or `0` value. To enable strict comparison of both value and type, you set the following:

```
->pipe(new FillNull(array(
    "strict"=>true,
)))

```

Support
-------

[](#support)

Please use our forum if you need support, by this way other people can benefit as well. If the support request need privacy, you may send email to us at ****.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~473 days

Total

4

Last Release

1192d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a27c60d0b76ca63f2216334e1e7668bff2b75ef9ffcc601855d738f29e17dab?d=identicon)[koolreport](/maintainers/koolreport)

---

Top Contributors

[![dongnl](https://avatars.githubusercontent.com/u/5791383?v=4)](https://github.com/dongnl "dongnl (5 commits)")[![tuananhnghiem](https://avatars.githubusercontent.com/u/7497712?v=4)](https://github.com/tuananhnghiem "tuananhnghiem (2 commits)")

---

Tags

data-cleandata-cleaningmysql-reporting-toolsphp-reporting-toolsreporting-enginephpData ReportReporting ToolsMissing DataData Cleaning

### Embed Badge

![Health badge](/badges/koolreport-cleandata/health.svg)

```
[![Health](https://phpackages.com/badges/koolreport-cleandata/health.svg)](https://phpackages.com/packages/koolreport-cleandata)
```

###  Alternatives

[koolreport/laravel

Allow to use KoolReport seamlessly in Laravel

18277.7k](/packages/koolreport-laravel)[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21623.4k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
