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: 
Not applicable

Issue in Accumulate

Hi,

Please find the attachment which is showing me Accumulate values of  volume [ Month Year] Jan2013, Feb2013 and Mar2013 but

i want only Jan and Feb becuase volume has only two months, kindly guide me the solution.

Regards,

Zain.

Labels (1)
9 Replies
somenathroy
Creator III
Creator III

You may use Above() function like below code snipet with LOAD statement:

if(Above([ Month Year]) = [ Month Year], Accumulated field - Above(Accumulated field), Accumulated field) as MonthWiseValue

Regards,

Som

Not applicable
Author

Dear above() function isnt working in script, i used previous() instead of above() but it isnt working.

Regards

Zain.

somenathroy
Creator III
Creator III

Thanks for your correction.

Have a look the below code, hope it may helps:

A:

LOAD Right([Month Year],4) as year, Left([Month Year],3) as month, Date(Date#([Month Year],'MMMYYYY'),'DD/MM/YYYY') as MonthStart ,volume as Accumulated_Volume;

LOAD * Inline

[Month Year, volume

Jan2013,10

Feb2013,25

Mar2013,25];

B:

NoConcatenate

LOAD *, if(IsNull(Previous(year)),Accumulated_Volume , Accumulated_Volume - Previous(Accumulated_Volume)) as MonthWise_Volume

Resident A Order by year,MonthStart;

DROP Table A;

Regards,

Som

Not applicable
Author

Dear Som, thanks for your reply i resolved my problem through script but not your one, basiclly i want to know how to handle this issue in expression.

Regards,

Zain.

er_mohit
Master II
Master II

try this:

expression---> rangesum(above(sum(volume),0,RowNo()))

[ Month Year] adding your dimension

rob_greene
Contributor III
Contributor III

Hi Zain,

Can you share how you resolved this in the script please, I am trying to do this too.

I have done it in my table using the above function, but need it in the script.

if(order_id=Above( Total order_id),Amount-Above(Total Amount),0))

Many thanks

Rob

Not applicable
Author

Dear Rob,

Please find the attachment.

Regards,

Zain.

Not applicable
Author

Dear ER.Mohit,

I did but its give me continuing line for all months, i have attached the application (first one) kindly apply on it and send to me back, i need to show only jan and feb 2013 data.

rob_greene
Contributor III
Contributor III

Many thanks Zain,

I have done this now

IF( Tranche_ID=Previous(Tranche_ID)

     AND order_id=Previous(order_id)

           AND [Order_Version]<>Previous(Order_Version),

               Amount - Previous(Amount),Amount ) AS Delta2

It worked a treat.


Rob

(note:above function in script)