Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewwizard
Master II
Master II

percentage calculation front end

Hi All,

I have two tables SALTable and COMMTable and want to do SAL % with COMM/SAL and GRADE.

SAL column have the nulls.

How to achieve the same in report front end as shown below reports.

Please help me. Thanks in advance.

SAL%:

=(Sum({<Year=, Quarter=, Month=,DATE={'>=$(=vStartDate)<=$(=vMaxDate)'}>}  SAL)

/

(Sum({<Year=, Quarter=, Month=,DATE={'>=$(=vStartDate)<=$(=vMaxDate)'}>}  COMM)))

GRADE:

if(SAL%>=0 AND SAL%<0.1,'0%-10%',

if(SAL%>=0.1 AND SAL%<0.2,'10%-20%',

if(SAL%>=0.2 AND SAL%<0.3,'20%-30%',

if(SAL%>=0.3 AND SAL%<0.4,'30%-40%',

if(SAL%>=0.4 AND SAL%<0.5,'40%-50%',

if(SAL%>=0.5 AND SAL%<0.6,'50%-60%',

if(SAL%>=0.6 AND SAL%<0.7,'60%-70%',

if(SAL%>=0.7 AND SAL%<0.8,'70%-80%',

if(SAL%>=0.8 AND SAL%<0.9,'80%-90%',

if(SAL%>=0.9 AND SAL%<1.0,'90%-100%')

Required Report Output:

Capture.JPG

1 Solution

Accepted Solutions
jagan
Partner
Partner

PFA file for solution.

Regards,

Jagan.

View solution in original post

12 Replies
awhitfield
Partner
Partner

Hi most of it's done in to attached, you had an unwanted + in the sal% expression.

HTH - Andy

qlikviewwizard
Master II
Master II
Author

Hi awhitfield,

Thanks for the quick solution.

How to achieve the below one in report?

I don't have SAL % in script.

Kindly help.

Report2
SAL %No of Emps
0%-10%14
10%-20%0
20%-30%0
30%-40%0
40%-50%1
50%-60%0
60%-70%0
70%-80%0
80%-90%0
90%-100%0
buzzy996
Master II
Master II

Try let me us know,if it works.

sal% :

=Sum({<Year=, Quarter=, Month=,DATE={'>=$(=vStartDate)<=$(=vMaxDate)'}>}if(isnull(COMM),0,COMM))

/

Sum({<Year=, Quarter=, Month=,DATE={'>=$(=vStartDate)<=$(=vMaxDate)'}>}if(isnull(SAL),0,SAL))

qlikviewwizard
Master II
Master II
Author

Hi ,

I am getting as shown below:

Capture.JPG

But I want to show like below:

SAL %No of Emps
0%-10%14
10%-20%0
20%-30%0
30%-40%0
40%-50%1
50%-60%0
60%-70%0
70%-80%0
80%-90%0
90%-100%0
Kushal_Chawda

Please see the attached one

qlikviewwizard
Master II
Master II
Author

Hi Kush141087,

I want to show all the GRADES even data is NULL.

  

GRADENo of Emps
0%-10%14
10%-20%0
20%-30%0
30%-40%0
40%-50%1
50%-60%0
60%-70%0
70%-80%0
80%-90%0
90%-100%0

Please advise.

Kushal_Chawda

As % is calculated based on expression, the values which falls in particular grade only that % will be captured.

If you want to achieve the same result then it is possible in script only not on front end if I am not wrong

qlikviewwizard
Master II
Master II
Author

Hi Kush141087,

Please help to reply the answer at this thread percentage calculation in the script

Kushal_Chawda

I have replied on this thread