Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
gireesh1216
Creator II
Creator II

Add coloumn in row

Hi Team,

I Have a data like this.

ERROR.PNG

I want to add two additional rows into each LOB like Total and %.Please find below image.

ERROR1 (2).PNG

In total 0.66 menas 66%

             0.81 means 81%

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

This is what I have used in Script..

Data:

Load * Inline

[

  LOB, Branch, Student, Present

  B.TECH, IT, 25, 24

  B.TECH, EEE, 30, 10

  B.TECH, ECE, 27, 20

  B.TECH, CSE, 30, 30

  INTER, MPC, 12, 10

  INTER, CTC, 25, 20

];

Dim:

LOAD * Inline [

Dim

1

2

3

];

Now create a Pivot Table

Dimension

1) LOB

2) =Pick(Dim, Branch, 'Total', '%')

Expression

1)

=Pick(Dim,

  Sum(Student),

  SUM({1<LOB,Branch>}Student),

  Num(SUM(Student)/SUM({1}Total <LOB> Student),'#0%')

  )

2)

=Pick(Dim,

  Sum(Present),

  SUM({<LOB, Branch>}Present),

  Num(SUM(Present)/SUM({1}Total <LOB> Student),'#0%')

  )

View solution in original post

12 Replies
tresesco
MVP
MVP

Could you provide a sample qvw?

sunny_talwar

Would you be able to share a sample to try this out?

MK_QSL
MVP
MVP

Use like this..

Don't know how you got 0.66 and 0.81

MK_QSL
MVP
MVP

Change the 2nd expression as below

=Pick(Dim,

  Sum(Present),

  SUM({1}Present),

   Num(SUM(Present)/SUM({1}Total <LOB> Student),'#0%')

  )

MK_QSL
MVP
MVP

84/112 = 75% not 66%

karthiksrqv
Partner - Creator II
Partner - Creator II

Hi,

I don't think we can have totals come up as a percentage when the data-rows are in numbers.

One way could be to enable sub-totals and to then use the title to show the overall percentage of present. This way a user can select a particular LOB and see the % if required, and the sub-totals will always be there.

gireesh1216
Creator II
Creator II
Author

Hi Please share screen shot(UI+SCRIPT)...I have personal edition only...

gireesh1216
Creator II
Creator II
Author

Hi Bro..

This is sample data.I am not calculated %.Manualy Cteated.Please suggest me any idea...

MK_QSL
MVP
MVP

This is what I have used in Script..

Data:

Load * Inline

[

  LOB, Branch, Student, Present

  B.TECH, IT, 25, 24

  B.TECH, EEE, 30, 10

  B.TECH, ECE, 27, 20

  B.TECH, CSE, 30, 30

  INTER, MPC, 12, 10

  INTER, CTC, 25, 20

];

Dim:

LOAD * Inline [

Dim

1

2

3

];

Now create a Pivot Table

Dimension

1) LOB

2) =Pick(Dim, Branch, 'Total', '%')

Expression

1)

=Pick(Dim,

  Sum(Student),

  SUM({1<LOB,Branch>}Student),

  Num(SUM(Student)/SUM({1}Total <LOB> Student),'#0%')

  )

2)

=Pick(Dim,

  Sum(Present),

  SUM({<LOB, Branch>}Present),

  Num(SUM(Present)/SUM({1}Total <LOB> Student),'#0%')

  )