Quantcast
Channel: SCN : All Content - SAP BusinessObjects Design Studio
Viewing all articles
Browse latest Browse all 4216

Calculation of Previous year

$
0
0

Dear Experts,


I have to get the previous year value based on the selected year. I have done the following at "On Startup" event:

 

var curr_year="";

curr_year = DROPDOWN_YEAR.getSelectedValue();

 

var prev_year="";

 

Further I have written the following code:

 

prev_year = curr_year - 1;

 

For the code written in bold, I am getting following error:

 

Error: "String" and "int" passed. The arguments of operator "-" must have the same type

 

To resolve this, I even tried the following code:

 

Convert.stringToInt(curr_year);

Convert.stringToInt(prev_year);

 

 

I browsed through various links. Few links are below:

 

Default system month and year

 

Variable selection in Dropdown

 

I am still not able to get the previous year value. How to do simple mathematical calculation getting rid of string/int issues?

Please help.

 

Thanks and Regards,

Nitesh Kumar


Viewing all articles
Browse latest Browse all 4216


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