Dataview block with Numbers & Text
Hi Guys,
I've a formatting issue with a dataview for a accounting report.
In one block, I need to have a percentage resulting from a calculation of 2 other blocks when a condition is fulfilled. Otherwise I need "N/A" to be displayed.
So far, I did the follow in my dataview :
- created 1 algo block for the percentage calculation (I used the nexel Deepest rules as the formula is different according to the row).
- created 1 algo block, that truncates the result obtained in the previous block
- created a last algo block (text), that takes the content of the previous one or writes "N/A".
The problem with this solution is that I lose the formatting of my percentages (i.e. negative between brackets, green for positive percentage, red otherwise).
Does somebody have a better solution so that I can have both my formatted percentages and some text in the same block.
Thanks in advance,
Aurore
Answers
-
Hi,
I think the easiest way would be to use 2 blocks. One with NEXEL and Numeric Type and one (also Nexel) as Text with some string manipulation, like if(a=0;"N/A"; if(a<0;"["&abs(truncate(a;2))&"]";truncate(a;2)) [I used pseudo code, so you might have to cange some stuff in your case).
Then you display the Text Block with an Alert by using the Nexel Block.
Regards
Björn
0 -
Hi Aurore Lb,
since you want to display either text or a number in your "percentage-block", this would have to be displayed as "text", which, on the other hand will not offer any possibility of formatting according to values.
In my opinion you'd need your values to be concatened according to your needs and achieve the colouring by an alarm referencing another block.
Something like
if(<condition>, if(a<0, "("&a&")%", a&"%"), "N/A"))
But, be aware that figures being displayed as text, loose their formatting concerning decimal and thousand separators .
Kind Regards,
Helmut
0 -
HI Björn Reuber and Helmut Heimann,
Thanks a lot for your answers !
So I did what you suggested and got the result I wanted.
I just added one text block with the pseudo code you gave me and then I used an alert on the calculation block for the formatting.
Best regards,
Aurore
0
Categories
- All Categories
- 1.8K Forums
- 1.7K Platform
- 106 Academy
- 280 Resources
- 3 Community Captains
- 1 About Community Captains
- 1 Meet the Community Captains
- 1 Topics & Thought Starters
- Board Manual
- 50 Best Practices
- 41 How-To Guides
- 25 Board Advocacy Program
- 157 Blog
- 4 Groups Hub
- 4 About Groups
- New Community Members
- DACH
- Japan
- Academy
- 2 Board Academy
- 7 ILT/VILT Course Catalogue
- 13 e-Learning Course Catalogue
- 4 Academy Forum
- 1.1K Idea Exchange
- 305 Partner Hub
- 2 Solution Sales Toolkits
- 91 Support
- 14 FAQ's
- Customer Support Portal
- 54 Support Articles
- BEAP