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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rangesum and variables

Hi,

I need to accumulate the results of the expression "Sales*Percentage" in Qlik Sense Desktop.

I´,ve tried this options:

1. RangeSum(Above($(vSales), 0, RowNo())),

where $(vSales) = sum({<IDAccount={'40'}>}Sales*Percentage

2. RangeSum(Above((sum({<IDAccount={'40'}>}Sales*Percentage)), 0, RowNo())),

And I have the results but they are not cummulative

I need a clue to solve this.

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Do you have more than one dimensions? May be this

RangeSum(Above(TOTAL Sum({<IDAccount={'40'}>}Sales*Percentage), 0, RowNo(TOTAL)))

View solution in original post

7 Replies
sunny_talwar
MVP
MVP

Do you have more than one dimensions? May be this

RangeSum(Above(TOTAL Sum({<IDAccount={'40'}>}Sales*Percentage), 0, RowNo(TOTAL)))

Anonymous
Not applicable
Author

Thanks Sunny, you are the best!!

And can I replace the whole sum by the variable $(vSales)?

sunny_talwar
MVP
MVP

I believe you should be able to do that

Anonymous
Not applicable
Author

Great Sunny! It worked!

and I have a last question.

I to use an expression like this:

RangeSum(Above(Sum(Sales), 0, RowNo())) / Sum(total Sales)

but in my case, I need to use $(vSales) instead of Sales.

I used this:

RangeSum(Above(Total $(vSales), 0, RowNo(Total))) / Sum(total $(vSales))

But it didn´t worked.


Could you please tell me what the mistake is?





sunny_talwar
MVP
MVP

I think since vSales is already Sum(Sales), you cannot really do this Sum(TOTAL Sum(Sales))... you will either need to create a new variable like this Sum(TOTAL Sales) or specify the whole expression here

Anonymous
Not applicable
Author

I tried this:

RangeSum(Above(TOTAL $(vVentas), 0, RowNo(TOTAL))) / $(vSales)

where $(vSales) is:

sum({<IDAccount={'40'}>}Total Sales*Percentage)

but it didn´t worked

Anonymous
Not applicable
Author

I found another mistake and solved it.

It´s working now.

I appreciatte so much your help.

Thanks Sunny!