Need a special offer?Find out if your project fits.
+

Conditional Column in Hierarchical Formatting

Answered
Kapil Kanagal asked on January 18, 2022

Hey Team,
 
Happy New Year! Had a quick question on how to create a column in the flexmonster UI using conditional column construction and hierarchies. In the image attached, I want to create a new columns (named theta_2) which uses the following formula:
within the strike hierarchy level, if the total sum of qty = 0.0 (highlighted in the first column), set theta_2 = 0; otherwise theta_2 = theta
 
Please let me know if this would all be possible to construct in the flexmonster UI. Happy to share more detail if needed to get to the bottom of this.

Thanks,
Kapil
 
 

4 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster January 19, 2022

Hello, Kapil!
 
Thank you for contacting us.
There is a way of adding a calculated value via UI:

  1. Select the "Fields" tab in the Toolbar.
  2. Press "Add calculated value" in the Field List.
  3. Here you can drag&drop values from the list and add functions. The formula you described can be calculated with the "if" conditional operator. Syntax: if(condition, then, else).
  4. Specify "Value name" as "theta_2" in the input field.

For more info, please refer to this page with text descriptions and videos about the Flexmonster UI, including a section about calculated values: https://www.flexmonster.com/user-interface/
 
Feel free to contact us if any questions arise.
 
Best Regards,
Maksym

Public
Kapil Kanagal January 21, 2022

Hi Maksym,
 
Thanks for the timely response. Couple of quick things -- I have been able to create a calculated value in the Fields tab in the past, but this time the value is based off an aggregation condition. If the aggregate sum of the qty == 0 when the data is grouped by strike level, then I want to create a column theta_2 that will be 0 (or just equal to theta otherwise). I have attached another screenshot below to show what my current formula is and the hierarchy levels for my conditional column. Hopefully this clarifies better, but what is the correct way to go about this?
 
Also is there a way to color code columns in Flexmonster?

Public
Maksym Diachenko Maksym Diachenko Flexmonster January 24, 2022

Hi, Kapil!
 
Hope you are doing well.
 
After adding a calculated value, it would be displayed as a separate measure. The formula of this measure would be calculated for all rows and columns of the data, either grouped or not. We recommend predefining all the measures you need in the report to be displayed on every load.
 
Speaking of setting colors to columns, there are two ways to do it:

  1. Via applying styles to classes of cells in a CSS file. You can see the list of cells' classes via Developer Tools in your browser. Check out the example of this approach: https://jsfiddle.net/flexmonster/y6e4qxhv/.
  2. Via the customizeCell function, which is defined as a standard API call or as an initialization parameter. Please see this documentation page for more details and examples; you can also refer to this JSFiddle, where the columns are highlighted depending on their index.
  3. Also, you can format cells (which includes highlighting them with some color), depending on whether the data satisfies the predefined conditions. This feature is called Conditional Formatting. You can find its settings menu in the "Format" tab of the Toolbar.  

 
Feel free to contact us if additional questions arise.
 
Best Regards,
Maksym

Public
Maksym Diachenko Maksym Diachenko Flexmonster February 4, 2022

Hi, Kapil!

We were wondering if our response helped with the question.
Looking forward to hearing from you.

Best Regards,
Maksym

Please login or Register to Submit Answer