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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
captain89
Creator
Creator

Rangesum(Before( is not working right

Hi esperts,

In my data model I have only one table with simple fields (dimensions and values).

I need to make a progressive sum in a week of production for a quantity field ([Qt Movimento Coeff.]).

But the result of the sum seems bad.

It adds one value for each day:

26891+35785=62676 (qlik shows 62677) +22205= 84881 (qlik shows 84883)

The First Formula (Parziale) = SUM([Qt Movimento Coeff.])

The Second One   (Progressivo) = rangesum(before(sum([Qt Movimento Coeff.]), 0, 7),MGiornoN)

MGiornoN is a parallel dimension of >MGiorno

0=Lun 1=Mar, 2=Mer, 3=Gio, 4=Ven, 5=Sab, 6=Dom

What am I doing wrong?

CH03Image.png

Thanks

1 Solution

Accepted Solutions
Sergey_Shuklin
Specialist
Specialist

Hello!

I think the reason of result+1 issue is this part of your expression:

rangesum(before(sum([Qt Movimento Coeff.]), 0, 7),MGiornoN)


Because RangeSum(Value1, Value2, Value3 etc.) function means the sum of all values separated by the comma.


View solution in original post

3 Replies
Sergey_Shuklin
Specialist
Specialist

Hello!

I think the reason of result+1 issue is this part of your expression:

rangesum(before(sum([Qt Movimento Coeff.]), 0, 7),MGiornoN)


Because RangeSum(Value1, Value2, Value3 etc.) function means the sum of all values separated by the comma.


captain89
Creator
Creator
Author

ahah, ok now it works!

I thought that the second part of the rangesum formula was to select which one field you consider for the interval 0,7.

But now I don't know why i must write the interval 0,7 if the interval is ever 0,6. (from Mon to Sun)

It works when i write 0,7 but it doesn't for 1,7 and 0,6.  Why?

Thanks!

Frank_Hartmann
Master II
Master II

0=Lun 1=Mar, 2=Mer, 3=Gio, 4=Ven, 5=Sab, 6=Dom

--> 7 Values