How can display % of the previous bar value in column chart

Nam Tran shared this question 7 years ago
Answered

Hello all,


I'm creating column chart with some complicated requirements.

1. Display negative value as Red color and Positive value as Green color

2. The Red bar column have to displayed negative value and also display the % between "Red bar value" and "Previous Green bar value)


I have resolved the first item #1 as "Vertical_chart_YF.png" file.

However, I cannot display the % value at Red bar as "Vertical_chart_Old.png" file.


Can you please tell me we can resolve the second item #2 with Yellowfin?

If yes, can you please suggest me a solution?


Thank you for the support.

Replies (1)

photo
1

Hi Nam,


While doing calculations relative to other columns is easy within Yellowfin, doing calculations between rows of a column is much harder, and will either require a custom advanced function or some very fancy sub-query joining. Can you please send me a screenshot of your "edit->data" tab so that I can get a better idea of the foundation you are building from here? (if you could annotate what columns are being used in the chart it would be very helpful)


Regards,

Nathan

photo
1

Hi Nathan,

Please get the attached file "Vertical_chart_YF-2.png" for data and the rendered chart for this data is "Vertical_chart_YF.png".

Currently, the green/red bars show "Count" values only.

As our requirement, the green bars show "Count" values and the red bars should show values as "Vertical_chart_Old.png" as below:

- The "Subject 2" red bar should show value "1 Topics (0.04%)" (with 0.04% = 1/2494)

- The "Subject 4" red bar should show value "649 Topics (26.03%)" (with 26.03% = 649/2493)

- Similar for other red bars

If there is any unclear point, please tell me.

Thank you for your support.

photo
1

Hi Nam,


Thank you for the clarification. Unfortunately this will be difficult and will require one of two approaches:


  1. You can do this math using a custom advanced function (written in Java, or another language using our Python or R plugins)
  2. Another possibility is, if you can convert that project number into a numeric field, you can then create a calculated field "project - 1". You could then join an append sub-query on "project-1" = "project". Within this append sub-query you can then do the necessary math.


Please let me know if either of these options are of interest or applicable to you.


Regards,

Nathan

photo
1

Hi Nathan,


Assume that I can use 2 above solutions as your suggested and calculate the field with values such as "1 Topics (0.04%)" and "649 Topics (26.03%)", etc.

How can I show these values in column chart with chart values must be number values?


Thanks and best regards,

Nam

photo
1

Hi Nam,


When using either of these approaches, your final result should be a number. In this example I have converted my Group field into a numeric column:

c0f96eb99294f10a98ebf7e6b18e7d53


All of these fields will be usable in a graph.


Please let me know if this helps clarify.


Regards,

Nathan

photo
1

Hi Nathan,


Thank you for your great support.


I'm sorry if I make you confuse, but my main problem is display the string values such as "1 Topics (0.04%)" and "649 Topics (26.03%)", etc in column chart as my above comment.

The column chart that I would like to show is same as "Vertical old chart" but I don't know how to show these string values in column chart. As I know, the column chart must show a metric with values are numbers, is it right?


Thanks and best regards,

Nam

photo
1

Hi Nam,


My apologies, I thought the difficulty was in getting the appropriate value. In my suggestions, this would have to be done through a third metric on the chart. Unfortunately our labeling options are slightly limited. However, we will be expanding these with 7.3+ as well as including JavaScript charting, which will allow you to create highly customized graphs using some of the many charting libraries available.


Sorry for the inconvenience here, I will continue to look for tricks to do this, but in the current version I am leaning towards thinking that this may not be possible.


Regards,

Nathan

photo
1

Hi Nathan,


Thank you for your support.

If possible, please inform me when the updated version was deployed.


Thank you very much,

Nam

photo
1

Hi Nam,


No problem! The official 7.3+ release was actually officially deployed on Thursday of last week and can be found on our webpage (both fresh installation and upgrade installer available).


I am going to set this case to closed for now, but if you have any more questions, just reply and the case will automatically be re-opened!


Regards,

Nathan

photo
1

Hi Nathan,


Thank you for your support.

I will try with Javascript charting in 7.3+ version as your suggestion and inform you if there is any issue.


Best regards,

Nam

photo
Leave a Comment
 
Attach a file