Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

How to write a Cumulative expression for attached data

Hello All,

             I was trying to write a cumulative sum expression but some reason it is giving zero as out put ..what i mean is

                          For

                                      Calmonth(Field) =201705-----it has to sum 201704+201705

                                                                 =201706------it has to sum 201704+201705+201706

                                                                    ........So on

                               Expression i tried is :

                                                                 RangeSum(Above(sum(VOLUME)), 0, RowNo())

                                                                      

Any suggestion on how to write a cumulative expression for below attached data ..

15 Replies
PrashantSangle

Hi,

try

Rangesum(Above(sum(VOLUME),0,RowNo(TOTAL)))

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
kunkumnaveen
Specialist
Specialist
Author

Thanks Man its is working but Anil ,is it possible to modify your expression ,i mean your expression is prefect when

if(month<month(today),RangeSum(above(TOTAL sum(VOLUME),0,RowNo(TOTAL))),   ?  )


if month = month(today),then it should not sum current month value...

i mean  current month is September so till august the above expression is prefect and from September to above

201708=sum(201704 to 201708)

201709=sum(201704 to 201708) because  month is not lesser than month of today

201710=sum(201704 to 201709)

201711=sum(201704 to 201710)

Anil_Babu_Samineni

May be possible using this..

if(month<month(TOTAL today()),RangeSum(above(TOTAL sum(VOLUME),0,RowNo(TOTAL))),  'you can initiate anything' )


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PrashantSangle

Hi,

Your logic work.

what do you want to show if month<month(Today()) is not true ????

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
kunkumnaveen
Specialist
Specialist
Author

HI,

i am trying to convert

your expression=RangeSum(above(TOTAL sum(VOLUME),0,RowNo(TOTAL)))

in to this

Sum({<CALMONTH ={">=$(=YearStart(Max(CALMONTH))) <=$(=max(CALMONTH))"}>} VOLUME)


but something i am missing ,can you help


Anil_Babu_Samineni

you can write this

RangeSum(above(TOTAL sum({<CALMONTH ={">=$(=YearStart(Max(CALMONTH))) <=$(=max(CALMONTH))"}>} VOLUME),0,RowNo(TOTAL)))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful