Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have below data. Column 5 is the expected value required.
I tried using RangeSum it is not working.
Dimension: Column 1-4
Expression 1: Sum(Value)
Expression 2: RangeSum(Above(Total Sum(Value),0,RowNo(TOTAL)))
Can some please help.
Country | State | Branch | Value | Expected Value |
---|---|---|---|---|
C1 | S1 | B1 | 1 | 1 |
C1 | S1 | B2 | 2 | 3 |
C1 | S2 | B3 | 3 | 6 |
C2 | S4 | B4 | 4 | 4 |
C2 | S5 | B5 | 5 | 9 |
C3 | S5 | B6 | 6 | 15 |
Hi, I spotted the difference, now I have the same doubt as Manish, why that 15? shouldn't be '6' (it's a new country so it starts again)?
I attach a new document with this behaviour, I used a hidden column to calculate how many rows of the same country has to sum the above() function.
try this
RangeSum(Above(Sum(Marks), 0, RowNo()))
try this
a:
LOAD Country,
State,
Branch,
Value
//[Expected Value]
FROM
[https://community.qlik.com/thread/239515?sr=inbox&ru=69692]
(html, codepage is 1252, embedded labels, table is @1);
Final:
NoConcatenate
Load Country,
State,
Branch,
// Value,
If(Peek(Country)=Country,PEEK('Value'),0)+Value as Value
Resident a Order by Country;
Drop Table a;
I doesn't work. Sum(Value) and RangeSum(Above(Sum(Marks), 0, RowNo())) provides same result set.
you can try full accumalation option in Expression tab
orelse try
Accumalate[2] stepback option below that
Hi Chanty,
The script was working fine for the above data. It doesn't work fine for the below data.
Also I need this to be written in Chart. Please help.
you can try this in script
you can try full accumalation option in Expression tab
orelse try
Accumalate[2] stepback option below that
Hi Chan
Hi Chan,
RangeSum is calculated at Country Level.
Full Accumulation or Accumulate 2 steps back won't work for this scenario.
Thanks
Jagan
Hi Jagan,
Can you explain the logic behind getting 15 for last row?