Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlik_Ajanta_Pharma
Contributor II
Contributor II

Overall percentage requirement

Year 2023-24 2024-25 2025-26
Material Purchase Rejection Count % Rejection Count % Rejection Count %
Totals 305 100.00% 375 100.00% 245 100.00%
100 33 10.82% 53 14.13% 30 12.24%
101 136 44.59% 167 44.53% 102 41.63%
102 13 4.26% 46 12.27% 21 8.57%
104 2 0.66% 3 0.80% - 0.00%
105 2 0.66% 1 0.27% 2 0.82%
106 40 13.11% 25 6.67% 31 12.65%
108 74 24.26% 78 20.80% 57 23.27%
110 3 0.98% 1 0.27% 1 0.41%
111 - 0.00% 1 0.27% 1 0.41%
118 1 0.33% - 0.00% - 0.00%
121 1 0.33% - 0.00% - 0.00%

 

can some help to bring percentage.(the second measure will be the output)

Labels (1)
1 Solution

Accepted Solutions
Daniel_Castella
Support
Support

Hi @Qlik_Ajanta_Pharma 

 

With this input data I created a pivot table with the following parameters:

Dimension: =if(Fiscal_Year_name_Rej_PD >= '2023-24' and Material_PGr<>'-', Material_PGr)

Column: Fiscal_Year_name_Rej_PD

Measure 1: count(distinct {<Material_PGr =- {'NA'}>}Material_Date_Key)

Measure 2: count(distinct {<Material_PGr =- {'NA'}>}Material_Date_Key)/count(TOTAL <Fiscal_Year_name_Rej_PD> distinct {<Material_PGr =- {'NA'}>}Material_Date_Key)

 

I had to modify the first dimension due to a row appeared with Material_PGr as -. Also, for this dimension ensure to disable the Include Null Values option and activate the Show Totals.

With this, I obtain the table I think you are expecting:

Daniel_Castella_0-1762425505580.png

Let me know if it works on your side.

 

Kind Regards

Daniel

View solution in original post

12 Replies
Daniel_Castella
Support
Support

Hi @Qlik_Ajanta_Pharma 

 

To calculate the percentages in Qlik, it should be =sum([Rejection Count])/sum(TOTAL [Rejection Count]) as a measure in your table.

 

Is this the issue you are having or am I missing something?

 

Kind Regards

Daniel

Qlik_Ajanta_Pharma
Contributor II
Contributor II
Author

 if i m using =sum([Rejection Count])/sum(TOTAL [Rejection Count]) it returns overall total

Daniel_Castella
Support
Support

Hi @Qlik_Ajanta_Pharma 

 

My bad, I did it quickly only for one year. Try this formula:

=sum([Rejection Count])/sum(TOTAL <Year> [Rejection Count])

 

I obtain this table then:

Daniel_Castella_0-1762419471203.png

 

The values match with the ones you posted at the beginning. Let me know if it works for you.

 

Kind Regards

Daniel

Qlik_Ajanta_Pharma
Contributor II
Contributor II
Author

not working dimension1: =if(Fiscal_Year_name_Rej_PD >= '2023-24', Material_PGr)

                    dimension2: Fiscal_Year_name_Rej_PD

                    Measure: count(distinct {<Material_PGr =- {'NA'}>}Material_Date_Key)

Daniel_Castella
Support
Support

Hi @Qlik_Ajanta_Pharma 

 

Could you, please, share an excel with your input data? I mean, I recreated your table using the excel that is already attached, but I understand this is the output you want.

 

To properly check a solution, it is better to start from your input.

 

Kind Regards

Daniel

Qlik_Ajanta_Pharma
Contributor II
Contributor II
Author

added 3 fields 

Daniel_Castella
Support
Support

Hi @Qlik_Ajanta_Pharma 

 

With this input data I created a pivot table with the following parameters:

Dimension: =if(Fiscal_Year_name_Rej_PD >= '2023-24' and Material_PGr<>'-', Material_PGr)

Column: Fiscal_Year_name_Rej_PD

Measure 1: count(distinct {<Material_PGr =- {'NA'}>}Material_Date_Key)

Measure 2: count(distinct {<Material_PGr =- {'NA'}>}Material_Date_Key)/count(TOTAL <Fiscal_Year_name_Rej_PD> distinct {<Material_PGr =- {'NA'}>}Material_Date_Key)

 

I had to modify the first dimension due to a row appeared with Material_PGr as -. Also, for this dimension ensure to disable the Include Null Values option and activate the Show Totals.

With this, I obtain the table I think you are expecting:

Daniel_Castella_0-1762425505580.png

Let me know if it works on your side.

 

Kind Regards

Daniel

Qlik_Ajanta_Pharma
Contributor II
Contributor II
Author

Qlik_Ajanta_Pharma_0-1762426352199.png

 

But why it is not working in my dashboard....i already tried dat code

Qlik_Ajanta_Pharma
Contributor II
Contributor II
Author

Its working when i am load in new data, but not i m existing dashboard might be becoz master calender...

thanks for your great help...and let me know if there is any solution for dat...