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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to write this expression

Hi All,

I have one table:

TheMonth, BrazilStudents, TotalStudents

1, 100, 300

2, 200,500

3,50, 200

I use one Pivot table to show the Percentage

The column 'TheMonth' is used as dimension and use one expression for the Percentage,

and the logic is, if current is Month 1, the percentage is using 100/300

If the current is month 2, the percentage is usingg (100+200) / (300+500)

If the current is month 3, the percentage is using (100+200+50) / (300+500+200)

It is the accumulated result, how to write that expression?

Thanks.

4 Replies
er_mohit
Master II
Master II

See the attached file

Sokkorn
Master
Master

Hi,

This way:

Create Straight Table or Pivot Table with

     1. Dimension: TheMonth

     2. Expression:

=Num(

RangeSum(Above(Total Sum(BrazilStudents),0,RowNo()))/

RangeSum(Above(Total Sum(TotalStudents),0,RowNo()))

,'#,##0.00%')

See sample attached file

Regards,

Sokkorn

kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

try this Expression.

Ex:  RangeSum(Above(Sum(BrazilStudents),0,RowNo()))/

RangeSum(Above(Sum(TotalStudents),0,RowNo()))

Find the attached file.

Not applicable
Author

try this in expression,

rangesum(Above(BrazilStudents),0,rowno()) / rangesum(Above(BrazilStudents),0,rowno(TotalStudents))