# Error in generating NCA Report

**URL:** <https://discourse.pumas.ai/t/error-in-generating-nca-report/693>\
**Category:** NCA\
**Created:** [June 2, 2022, 5:30am UTC](https://discourse.pumas.ai/t/error-in-generating-nca-report/693 "2022-06-02T05:30:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aarun](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aarun](https://discourse.pumas.ai/u/Aarun)\
**Post date:** [June 2, 2022, 5:30am UTC](https://discourse.pumas.ai/t/error-in-generating-nca-report/693/1 "2022-06-02T05:30:20Z")

</div>

Hi,  
I performed a NCA analysis of a data with extravascular administration(apparent clearance is represented as `cl_f_obs`) and got the below error while trying to generate the report.

```auto
julia> report(NCA_Report, output="nca_report_pdf")
ERROR: ArgumentError: column name :cl not found in the data frame; existing most similar names are: :id and :kel
Stacktrace:
  [1] lookupname
    @ /builds/PumasAI/PumasSystemImages-jl/.julia/packages/DataFrames/MA4YO/src/other/index.jl:395 [inlined]
  [2] getindex
    @ /builds/PumasAI/PumasSystemImages-jl/.julia/packages/DataFrames/MA4YO/src/other/index.jl:401 [inlined]
  [3] (::DataFrames.var"#35#36"{DataFrames.Index})(i::Symbol)
    @ DataFrames ./none:0
  [4] iterate
    @ ./generator.jl:47 [inlined]
  [5] collect_to!
    @ ./array.jl:782 [inlined]
  [6] collect_to_with_first!
    @ ./array.jl:760 [inlined]
  [7] collect(itr::Base.Generator{Vector{Symbol}, DataFrames.var"#35#36"{DataFrames.Index}})
    @ Base ./array.jl:734
  [8] getindex
    @ /builds/PumasAI/PumasSystemImages-jl/.julia/packages/DataFrames/MA4YO/src/other/index.jl:407 [inlined]
  [9] stack(df::DataFrame, measure_vars::Vector{Symbol}, id_vars::Vector{Symbol}; variable_name::Symbol, value_name::Symbol, view::Bool, variable_eltype::Type)
    @ DataFrames /builds/PumasAI/PumasSystemImages-jl/.julia/packages/DataFrames/MA4YO/src/abstractdataframe/reshape.jl:144
 [10] summarize(data::DataFrame; stratify_by::Vector{Symbol}, parameters::Vector{Symbol}, stats::Vector{Function})
    @ NCA /builds/PumasAI/PumasSystemImages-jl/.julia/packages/NCA/LWAon/src/type.jl:627
 [11] summarize(data::DataFrame)
    @ NCA /builds/PumasAI/PumasSystemImages-jl/.julia/packages/NCA/LWAon/src/type.jl:620
 [12] top-level scope
    @ ~/data/code/NCA_MCOPS/NCA_MCOPS.jl:97

```

I am using `Julia version 1.7.1 with NCA and NCAUtilities` packages and have the following questions

1. How to interpret this error and generate a report successfully?
2. The NCA results when saved as a dataframe gives the parameter values along with its units in each cell. How to restrict the units only to the column headers?

---

<div class="post-metadata">

**Author:** ![vijay](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/vijay/32/96_2.png) [@vijay](https://discourse.pumas.ai/u/vijay)\
**Post date:** [June 2, 2022, 5:57am UTC](https://discourse.pumas.ai/t/error-in-generating-nca-report/693/2 "2022-06-02T05:57:14Z")

</div>

> [@Aarun](#):
>
> How to interpret this error and generate a report successfully?

This is a bug in the older version that has been fixed in an upcoming version. @Vaibhavdixit02 can provide a workaround for you in the meanwhile

---

<div class="post-metadata">

**Author:** ![vijay](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/vijay/32/96_2.png) [@vijay](https://discourse.pumas.ai/u/vijay)\
**Post date:** [June 2, 2022, 5:59am UTC](https://discourse.pumas.ai/t/error-in-generating-nca-report/693/3 "2022-06-02T05:59:53Z")

</div>

> [@Aarun](#):
>
> The NCA results when saved as a dataframe gives the parameter values along with its units in each cell. How to restrict the units only to the column headers?

Try doing this `NCA.liftunits2header(NCA_Report.reportdf)`

---

<div class="post-metadata">

**Author:** ![Aarun](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aarun](https://discourse.pumas.ai/u/Aarun)\
**Post date:** [June 2, 2022, 6:19am UTC](https://discourse.pumas.ai/t/error-in-generating-nca-report/693/4 "2022-06-02T06:19:19Z")

</div>

Thanks Vijay, This works perfect.

---

<div class="post-metadata">

**Author:** ![Aarun](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aarun](https://discourse.pumas.ai/u/Aarun)\
**Post date:** [June 2, 2022, 6:25am UTC](https://discourse.pumas.ai/t/error-in-generating-nca-report/693/5 "2022-06-02T06:25:06Z")

</div>

> [@vijay](#):
>
> Try doing this `NCA.liftunits2header(NCA_Report.reportdf)`

Thanks Vijay, This works perfect.
