Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

cancel
Showing results for 
Search instead for 
Did you mean: 
vbravomo
Contributor III
Contributor III

Relative percentage

Hello,

I've used  Count({<Process,Date>}ID_CASE)/Count(total{<Process,Date>}ID_CASE) but the percentage that I get is over the total amount, and I need to get a percentage per the total of each month. I meant I need to get this table.

MonthTotalPercentage
January

100

100%
Process16060%
Process24040%
February200100%
Process18040%
Process212060%

Thank you

1 Solution

Accepted Solutions
sunny_talwar

Try this... notice how I don't have curly brackets before < and after >

Count(ID_CASO)/Count(TOTAL<MONTH_FECHA_CREACION_SINHORA> ID_CASO)


Capture.PNG

View solution in original post

11 Replies
ogautier62
Specialist II
Specialist II

Hi,

If you have : Month, Process in dimension :

count(ID_CASE) / count(total <Month> ID_CASE) * 100

regards

vbravomo
Contributor III
Contributor III
Author

Thank you, but it doesn't work. I need to get the percentage of cases over the total of the month, and per process.

I have two dimensión: date and process.

I have to get the porcentaje of the process 1 over the total of cases of January, and repeat it.

I need a graph where the axis X contain the months, an the axis Y contains the 100% of the cases. And each column have to have the grouped processes with different size depending on the relative percentage of each month.

I'm sorry if I don't explain good.

Regards

vinieme12
Champion III
Champion III

can you post some sample data and expected output

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ogautier62
Specialist II
Specialist II

that's what do code above,

could you share some data examples please

vbravomo
Contributor III
Contributor III
Author

Your code returns the percentage over the total(Jan+Feb+March...), not over the total of each month.

I've added a file with data and a pivot table that I expect to get.

sunny_talwar

Isn't this what you want?

Capture.PNG

ogautier62‌'s expression in general seems to work with some slight modifications

vbravomo
Contributor III
Contributor III
Author

Ok, you're rigth. It Works thanks. But the last problem.

Could you see my qvf y tell me why the same code doesn't work? I don't have the original file but:

  • FECHA_CREACION_SINHORA = Date
  • ID_CASO = ID_CASE
  • PROCESO = PROCESS

It doesn't work becaause if you check the numbers you realize that it's over the big total.:

Results:       "Cliente Fuera de Domicilio" in "ene" = 6229 / 2672204 (Total all months) = 0,23% 

Expected:    "Cliente Fuera de Domicilio" in "ene" = 6229 / 424471 (Total Ene) = 1,47%

Thank you

sunny_talwar

You need to create =Month(FECHA_CREACION_SINHORA) in the script to do this...

Month(FECHA_CREACION_SINHORA) as MONTH_FECHA_CREACION_SINHORA

and then use that as your dimension and this expression

Count(ID_CASO)/Count(total{<[MONTH_FECHA_CREACION_SINHORA]>}ID_CASO)

vbravomo
Contributor III
Contributor III
Author

Thank you, but this code returns the same results. I've got and attached the files if it could help.