Quantcast
Channel: SCN : Discussion List - SAP BusinessObjects Design Studio
Viewing all articles
Browse latest Browse all 4041

Javascript to calculate previous six months

$
0
0

I need help with the Javascript to calculate the previous six months based on the current month.  I tried using the While statement but that does not seem to be a valid statement in Design Studio.  The data I am reading does not always have data for every month so I cannot use an array of the 0CALMONTH values.  I want to do something like this (syntax is not correct just pseudo).

 

var month = APPLICATION.getInfo().dateNowInternalFormat.substring(4,2);

var year = APPLICATION.getInfo().dateNowInternalFormat.substring(0,4);

 

While (i < 6) {

   month = month - 1;

   if month > 1;

     month = 12;

     year = year - 1;

   endif.

i++;

 

}

 

Thanks.

Sandy


Viewing all articles
Browse latest Browse all 4041

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>