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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
bashar_f
Partner - Creator
Partner - Creator

How to create a percentage variable based on two other variables

Hi,

I have 2 variables,

vApplicationsCount  = Count(Apps)

vEnrolmentCount = Sum(Enrol_Status)

so basically in the end they are two numbers.

I need to create a new variable that is equal to the percentage of  enrolments over applications? 

% of Enr/Apps

What would the definition be?

1 Solution

Accepted Solutions
SergeyMak
Partner Ambassador
Partner Ambassador

Just because of percentage

vNewVar = NUM($(vApplicationsCount)  / $(vEnrolmentCount ), '#,##0%' ) Or you can use formatting from Number tab in you chart.

Regards,
Sergey

View solution in original post

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

You can do:

vNewVar = Count(Apps)/Sum(Enrol_Status)

or

vNewVar = $(vApplicationsCount)  / $(vEnrolmentCount )

SergeyMak
Partner Ambassador
Partner Ambassador

Just because of percentage

vNewVar = NUM($(vApplicationsCount)  / $(vEnrolmentCount ), '#,##0%' ) Or you can use formatting from Number tab in you chart.

Regards,
Sergey
bashar_f
Partner - Creator
Partner - Creator
Author

In the definition of the new variable, it recognizes when I type vApplicationsCount, is it really necessary to put the dollar sign here? Cant I just put the definition like this?

vApplicationsCount / vEnrolmentCount

Or

NUM(vApplicationsCount / vEnrolmentCount , '#,##0%' )

SergeyMak
Partner Ambassador
Partner Ambassador

It depends on your goal.

I usually use $-format

In case of vApplicationsCount you pass only text into the new variable. As I understand it will equal set vApplicationsCount='your text'

Regards,
Sergey
bashar_f
Partner - Creator
Partner - Creator
Author

I understand, Thank you very much.