Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Number Format
legend.ram
HI,<br />
<br />
I have one Data field (Decimal) where displaying Amount in Currency format like $1,234.50.<br />
<br />
But for my requirement If amount is more than 1 million i have to display in millions and have append the string <em class='bbc'><strong class='bbc'>in millions</strong></em>, if the amount is less than 1 million i have to display the whole number. In both cases number format should be same. The Data Field in Cross Tab.<br />
<br />
For Example: If amount is <em class='bbc'><strong class='bbc'>20000 </strong></em>have to display like <strong class='bbc'>$20,000.00</strong>.<br />
If amount is <em class='bbc'><strong class='bbc'>1000000 </strong></em>then have to dispaly like <strong class='bbc'>$1 (in Millions)</strong>.<br />
<br />
As i have created Decimal Data Field it wont accept String value (in millions) to append. If I change the field to String I cant able to format the number its displaying number without format.<br />
<br />
Even I have tried with some java script on rendor of the value, but format is not happening.<br />
<br />
Could anyone help me to fix this issue.<br />
<br />
Thanks in Advance...<br />
<br />
Regards,<br />
Ram
Find more posts tagged with
Comments
birtprofi
What is if you have to display 1.234.567,00 ?
regards
rafael
legend.ram
<blockquote class='ipsBlockquote' data-author="'birtprofi'" data-cid="67254" data-time="1281526950" data-date="11 August 2010 - 04:42 AM"><p>
What is if you have to display 1.234.567,00 ?<br />
<br />
regards<br />
rafael<br /></p></blockquote>
<br />
As the amount is more then 1 million i have to display <strong class='bbc'>$1.23 (in millions)</strong><br />
<br />
I am rounding to 2 decimals.
CalilJorge
<blockquote class='ipsBlockquote' data-author="'legend.ram'" data-cid="67256" data-time="1281527376" data-date="11 August 2010 - 04:49 AM"><p>
As the amount is more then 1 million i have to display <strong class='bbc'>$1.23 (in millions)</strong><br />
<br />
I am rounding to 2 decimals.<br /></p></blockquote>
<br />
I haven't found a funcion to round to 2 decimals, but you can do some logic like this:<br />
<br />
if(amount >= 1 million) {<br />
amount = round(amount/10000) / 100;<br />
}<br />
<br />
return Format_in_$$(amount);<br />
<br />
I got it right?<br />
<br />
Regards,<br />
Calil.
birtprofi
yes this works
if
(dataSetRow["AMOUNT"] > '1000000') (dataSetRow["AMOUNT"]/'1000000')
else
dataSetRow["AMOUNT"]
best regards
rafael
legend.ram
Hi,<br />
<br />
My Problem is not logic, its format issue.<br />
<br />
Please look at the attachment. In first cross tab, I am achieving rounding and formate by a style. And dispalying <em class='bbc'><strong class='bbc'>( in millions )</strong></em> string, upon the condition if amount is greater than 1000000. But as I am creating report in .xls format, amount and <em class='bbc'><strong class='bbc'>( in millions )</strong></em> are coming in 2 different cells. Which not looking fine. I want complete thing in one cell only.<br />
<br />
In the 2nd Crosstab I created String Data Field, There I am adding Currency Symbol manually and for the amount, if amount is greater than 1000000 dividing the amount by 1000000 and at the end appending <em class='bbc'><strong class='bbc'>in millions</strong></em> string, if amount is less then 1000000 dispalying the amount as it is. But in this case format is issue, as it is a String field I cant apply fromat number style to achieved 1000 separator and automatic Currency symbol. One more problem is when i created the report in .xls, in the excel sheet one info is showing in the columns <strong class='bbc'><em class='bbc'>Number Stored as Text</em></strong>, even this info i don't want.<br />
<br />
<br />
Even I attached the created .xls sheet with 2 cross tabs, please refer that attachment for getting clear idea about my requirement.<br />
<br />
I am just trying for script on presenting the value (onRender) read the number and apply the style and convert into string and append the string <em class='bbc'><strong class='bbc'>in millions</strong></em> if amount is greater than 1000000. Please let me know is this possible, if yes please provide me one example or modify in the attached report.<br />
<br />
My BIRT runtime is 2.5.1<br />
<br />
Thanks for your support.... <br />
<br />
Regards,<br />
Ram
birtprofi
there is no attached file
legend.ram
<blockquote class='ipsBlockquote' data-author="'birtprofi'" data-cid="67301" data-time="1281592385" data-date="11 August 2010 - 10:53 PM"><p>
there is no attached file<br /></p></blockquote>
<br />
Sorry, Please find now.
birtprofi
try this one.
cross tab 1 should work. Now you have the currency symbol if the value is < 1000000 and you have mil if the value is > 1000000 (I worked with 2 data elements and the visibility and format number function of birt)
If you export in excel, all the values are numbers and not text fields
Could you work with this?
best regards
rafael
legend.ram
Thanks allot... As I am new to BIRT I dont know about custom formatting...