Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
MVP & Luminary
MVP & Luminary

PFA file for solution.

Regards,

Jagan.

View solution in original post

12 Replies
Highlighted
Partner
Partner

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

HTH - Andy

Highlighted
Master II
Master II

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

Highlighted
Master II
Master II

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
Highlighted
MVP
MVP

Please see the attached one

Highlighted
Master II
Master II

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.

Highlighted
MVP
MVP

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

Highlighted
Master II
Master II

Hi Kush141087,

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

Highlighted
MVP
MVP

I have replied on this thread