Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Arjunarao
Honored Contributor 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
MVP & Luminary
MVP & Luminary

Re: percentage calculation front end

PFA file for solution.

Regards,

Jagan.

12 Replies
Partner
Partner

Re: percentage calculation front end

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

HTH - Andy

Arjunarao
Honored Contributor II

Re: percentage calculation front end

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
Honored Contributor II

Re: percentage calculation front end

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))

Arjunarao
Honored Contributor II

Re: percentage calculation front end

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

Re: percentage calculation front end

Please see the attached one

Arjunarao
Honored Contributor II

Re: percentage calculation front end

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.

Re: percentage calculation front end

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

Arjunarao
Honored Contributor II

Re: percentage calculation front end

Hi Kush141087,

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

Re: percentage calculation front end

I have replied on this thread