-
1. Re: Labeling a pie chart
Jonathan DrummeyDec 4, 2012 12:43 PM (in response to Chaya Gordon Burstyn)
See the attached. I used RAWSQL to format the numbers, that generally works easier in cases like this where we'd want to have commas or periods.
Jonathan
-
pie chart label.twbx.zip 1.1 MB
-
-
2. Re: Labeling a pie chart
Chaya Gordon Burstyn Dec 4, 2012 1:26 PM (in response to Jonathan Drummey)Thank you for your response.
The "messy label" formula works for me, only it puts a bunch to decimal places at the end of the revenue number that I don't want there. I'm not sure what RAWSQL is so I can't seem to use that formula, I get a data error.
Is there an easy way to get rid of those decimal places? Otherwise it works great.
-
3. Re: Labeling a pie chart
Chaya Gordon Burstyn Dec 4, 2012 1:50 PM (in response to Jonathan Drummey)On that same topic, I realized I have another number I want to add to that lable--I would also like the label to show a caluculated field I created for % of total revenue--is it possible to add a third piece of data to the label?
Thank you.
-
4. Re: Labeling a pie chart
Shawn Wallwork Dec 4, 2012 2:04 PM (in response to Chaya Gordon Burstyn) -
5. Re: Labeling a pie chart
Chaya Gordon Burstyn Dec 4, 2012 2:22 PM (in response to Shawn Wallwork)I think maybe this is getting way over my head--it doesn't want to use RAWSQL and is telling me something about applying it to table calculations and fields from multiple data sources.
-
6. Re: Labeling a pie chart
Shawn Wallwork Dec 4, 2012 2:31 PM (in response to Chaya Gordon Burstyn)Hi Chaya, don't give up yet. It would be best if you posted a packaged workbook with some sample data so we could see the structure of your data and what might be causing you problems. But if you can't do that provide a screen shot of your whole screen with the error you're getting so we can see what data sources you're using and what pills you have on what shelves. Like this:
(This is 8, your's will look different.)
--Shawn
-
7. Re: Labeling a pie chart
Chaya Gordon Burstyn Dec 6, 2012 10:04 AM (in response to Shawn Wallwork) -
8. Re: Labeling a pie chart
Shawn Wallwork Dec 6, 2012 10:29 AM (in response to Chaya Gordon Burstyn)Chaya, interesting I hadn't run into that before. So let's try a different route:
ATTR([CUSR_5]) + "
$" + RAWSQL_STR("FORMAT(%1,'##,##0')",SUM([Revenue from Scans]))+ "
" + STR(ROUND([Revenue % Total]*100,2))
You may or may not need that *100. Also if you want more or fewer decimals change that last 2.
--Shawn
-
9. Re: Labeling a pie chart
Chaya Gordon Burstyn Dec 6, 2012 10:40 AM (in response to Shawn Wallwork)That forumula works better, no errors in that, but i get a data error
SQL Server database error 0x80040E14: 'FORMAT' is not a recognized built-in function name.
Error retrieving collation for [sqlserver.41198.484064351855].[TEMP(TC_1)].
-
10. Re: Labeling a pie chart
Shawn Wallwork Dec 6, 2012 10:49 AM (in response to Chaya Gordon Burstyn)OK, let's just get rid of the RAWSQL altogether. Try this:
ATTR([CUSR_5]) + "
$" + STR(ROUND(LOOKUP(SUM([Revenue from Scans]),0),0))+ "
" + STR(ROUND([Revenue % Total]*100,2))
That should work. Let me know.
--Shawn
-
11. Re: Labeling a pie chart
Chaya Gordon Burstyn Dec 6, 2012 11:02 AM (in response to Chaya Gordon Burstyn) -
12. Re: Labeling a pie chart
Shawn Wallwork Dec 6, 2012 11:16 AM (in response to Chaya Gordon Burstyn)I guess I did forget the % sign. Glad we got it solved.
--Shawn
-
13. Re: Labeling a pie chart
Trishia Singla Aug 10, 2015 12:29 PM (in response to Shawn Wallwork)Hi Shawn,
I tried the formula in your previous comment but the numbers in the result at my end are not comma separated. I have always run into this problem.
Screenshot is attached. Is something i am missing in the formula? Please suggest.
-
Capture.JPG 127.9 KB
-
-
14. Re: Labeling a pie chart
Shawn Wallwork Aug 10, 2015 1:29 PM (in response to Trishia Singla)Trishia, thanks for searching the forums before posting a question! That's much appreciated. However this thread is almost 3 years old. It was probably back in the 6.0 or 6.1 days, which is many releases ago. So what worked back then won't necessarily work now, as much has changed in the product.
If your Parameter only has two options, one a count and the other currency, then you can use a different trick. This uses the negative number space in a custom format to get the two different formats. Do you only have two formats?
There is another workaround involving a MIN(1) trick that creates a scaffold to hang your different values on. But this is a little tricky, and will definitely require you to post a sample packaged workbook, for us to help you set it up.
Cheers,
--Shawn