Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

RANGESUM in chart bar

Hi,

I have a problem in bar chart while i was trying to write rangesum() function.

There are screenshots of table and bar chart.

In table, formula is: "küm.ciro"/"küm.ton"

     küm.ciro --> rangesum( before( sum([$(vCurrency) Satış]),0,NoOfColumns(TOTAL) ) )

     küm.ton ---> rangesum( before( sum([KG Satış]),0,NoOfColumns(TOTAL) ) )/1000

In bar chart, formula is: (sum([$(vCurrency) Satış]) / sum([KG Satış]))*1000

This means that -for example in second column.-

     table chart shows us (FirstValue + SecondValue) / 2 = (1.877,xx + 1.904,xx) / 2 = 1.891,xx

     bar chart shows us only SecondValue = 1.904

I have to do this in bar chart but dont know how to do.

Thank you for your help.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Perhaps like this: rangesum(above( (sum([$(vCurrency) Satış]) / sum([KG Satış]))*1000 ,0, rowno()))


talk is cheap, supply exceeds demand

View solution in original post

10 Replies
sunny_talwar

Is this in a pivot table? I think you will have to provide more details here and a sample will be really helpful

Not applicable
Author

Yes, it is in a pivot table.

I cant provide a sample cause this sheet works for my business -classified info-

Gysbert_Wassenaar

Perhaps like this: rangesum(above( (sum([$(vCurrency) Satış]) / sum([KG Satış]))*1000 ,0, rowno()))


talk is cheap, supply exceeds demand
jonathandienst
Partner - Champion III
Partner - Champion III

Try using Above() instead of Before() for the chart. Before is only meaningful in a pivot table.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sunny_talwar

Gysbert do we need RangeAvg() instead of RangeSum?

and also Before() and ColumnNo() as this seems to look like a pivot table. I might be wrong, but I am not really sure how the table is laid out

jonathandienst
Partner - Champion III
Partner - Champion III

I agree that you should use RangeAvg() rather than Rangesum, but I think Gysbert is correct using Above() and Rowno() for the chart

=RangeAvg(Above((sum([$(vCurrency) Satış]) / sum([KG Satış]))*1000 ,0, rowno()))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sunny_talwar

But are we not doing this in this direction ->

Capture.PNG

Unless this is a horizontal straight table, I feel we should use Before. What do you guys think?

sunny_talwar

Have you given this a shot?

=RangeAvg(Before((Sum([$(vCurrency) Satış]) / Sum([KG Satış]))*1000 , 0, ColumnNo()))

Not applicable
Author

I used RangeAvg and Above but bar chart and pivot table doesnt match.