I have Date,product,Quantity_Sold columns and I want
Product, MTD(month Till date),YTD(Year Till Date) as output.
Can anyone help me with the logic in getting MTD i.e
quantity sold from 1st of this month to till date (i.e. 01-
11-2013 to 26-11-2013) and YTD i.e QTD sold from 1st date
of the year to till date(i.e. 01-01-2013 to 26-11-2013).
Sample output model:
Product MTD YTD
Answer / naresh
HI All,
Follow below steps to achieve this
1) In Filter condition place the below condition (to_char([START_DATE],'YYYY')=to_char({sysdate},'YYYY') and [START_DATE] <= {sysdate})
2)Create one Derived colum as MTD and in Expression use below code
case when (to_char([START_DATE],'MM')=to_char({sysdate},'MM') and [START_DATE] <= {sysdate})
then [Quantiry] end
Next in properties if this column for aggrigate Function and for Rollup Aggrigate Function change 'automatic ' to 'None'.
3) create one more Derived column as YTD and in expression use below code
case when (to_char([START_DATE],'YYYY')=to_char({sysdate},'YYYY') and [START_DATE] <= {sysdate})
then [Quantity] end
here sysdate is oracle date function.
Thats it .
| Is This Answer Correct ? | 0 Yes | 0 No |
what is the difference between enterprise data warehouse and data warehouse
What is the difference between cognos 8.2 and cognos 8.3?
How to improve the performance of the report at the report level?
-------------------What is StarShema?
What is Performance Tunning Test?
Can you define pivot?
how to improve performance in report studio level
What are the Macros?
How do you deployment reports from one server (Development) to other server(Production)? How do you configure the cognos7.0 version cube in cognos 8.0? Pls, explain with example? How do you create IQD without IMR or can u explain other way create IQD?
What is the concept of using Dimension allocation "By Measure"? How Transformer use when computing the Base measue?
Explain is there any comparison available for cognos reportnet vs crystal reports?
can you tell me what are the dimension tables are used in project