If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Cumulative Sales

Started by barrysaab, 16 Mar 2012 11:02:48 PM

Previous topic - Next topic

barrysaab

I need to show cumulative sales for certain product type.I wrote following expression it is giving error:


Running-total ([Order Item Details].[Order Item Details].[Net Sale Item Qty] for (case when [Order Item Details].[Application].[Platform Name] ='ABC' then
[Order Item Details].[Order Item Details].[Net Sale Item Qty]
else
null)
end
)

and if i need to show monthly,quaterly,yearly cumulative sales separately,how this case statement should be written
Appreciate your help
Boy! Cognos getting on to me!!!

barrysaab

I wrote this expression for week up to yesterday

if ([Order Item Details].[Order Source].[Order Source]='GHJ'
and [Order Item Details].[Application].[Platform Name]='ABC'
and ([Order Item Details].[Activity Date].[Short Date] between _add_days (current_date,-7) and _add_days(current_date,-1)))
then
(running-total([Order Item Details].[Order Item Details].[Net Sale Amt (USD)]))
else
(0)

But it is giving incorrect results.Thanks
Boy! Cognos getting on to me!!!

blom0344

What happens when you apply the running-total over the entire If.. then.. else.. statement?

barrysaab

The expression is validated but values i am getting are incorrect.Thanks
Boy! Cognos getting on to me!!!

blom0344

Any chance you can put the logic in a filter instead of in the case.  Running aggregates are computed on the server AFTER fetching the data-set, which in your case may be the cause of misaligned data

barrysaab

I think this logic woudn't work in filter as read somewhere this should be avoided in filters,moreover,i need to show this running total column in report.Thanks
Boy! Cognos getting on to me!!!

blom0344

I do not mean putting the if then else and running-total in a filter  :o

Make sure you use a filter to create the proper dataset (ordering is relevant too) before the running-total is done by the server

barrysaab

Finally,Two Data Items  and my First Data Item Expression :

if ([Order Item Details].[Order Source].[Order Source]='iTunes')and ([Order Item Details].[Activity Date].[Short Date] between _add_days (current_date,-7) and _add_days(current_date,-1)))
then
([Order Item Details].[Order Item Details].[Net Sale Amt (USD)]) else(0)

And the second Data Item Expression :


running -total(if ([Order Item Details].[Application].[Platform Name]='iPad' )) then (First Data item) else (0)

I am not sure whether it is right.Thanks
Boy! Cognos getting on to me!!!