Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



I have Date,product,Quantity_Sold columns and I want Product, MTD(month Till date),YTD(Year Till D..

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

Post New Answer

More Cognos Interview Questions

How to apply securities for reports in cognos connection?

0 Answers   TCS,


Where do you edit cognos sql in report studio?

3 Answers   HCL,


what is model and say about process how to create model and how to test model?

0 Answers   IBM,


what is degenerate key in oracle ?whare do we use it?

0 Answers  


What is diffence between query calculation and layout calculation?

4 Answers  


what is an associated query?

2 Answers  


What is a Folder?

0 Answers  


how many numbers of cubes can we create on a single model? How can we navigate between those cubes?

0 Answers   IBM,


How can we improve performance in framework manager level?

3 Answers   Wipro,


what are typees of dimensions

11 Answers   HCL,


what is the difference between group span and level span

1 Answers   Satyam,


I have a report with list and cross tab in same page,How do you restrict one user can see only the list and other user can see both?

1 Answers   Facebook,


Categories