Casey Green Posted February 5, 2021 Posted February 5, 2021 I am building a table report in WebFocusDesigner that sums all of the margins allocated to a particular sales team over a period of time and sorts the results descending, starting with the highest margin. The stakeholder would like to see the first result (aka the row with the highest margin) in bold and red font. Is there a way to add a traffic light conditional to an entire row to achieve this
Joanne Quan 2 Posted February 8, 2021 Posted February 8, 2021 Hi Casey, Are you able to edit your report using the text editor If so, here is my suggested solution. Using the CAR sample data, I summed SALES by COUNTRY. Then I ranked the SALES field and sorted the values from largest to smallest. I saved the report and closed the window. In my home page, I navigated to this report and opened it in the text editor. Right before the ENDSTYLE tag, I added this code: $ TYPE=DATA, WHEN=RANK EQ 1, COLOR='RED', STYLE='BOLD', $ When I run the report, the first line (i.e. row with the highest sales) is displayed in bold, red font. Give this a try and let me know if it works.
Casey Green Posted February 8, 2021 Author Posted February 8, 2021 Hi Joanne, This worked perfectly. Thank you! One thing I noticed is that this solution only seems to work when creating a RANKED BY column which seems to be unhideable. Is it possible to do this without creating this column
Joanne Quan 2 Posted February 9, 2021 Posted February 9, 2021 The only solution I can think of requires the use of HOLD files. I first create my table with a TOT_SALES field and save the output to a HOLD file. Using the HOLD file, I compute a rank field and sort it by highest TOT_SALES. Then I style my output conditional on the rank field value. I am unable to provide step by step instructions for the GUI, but hopefully this code will give you some insight: TABLE FILE CAR SUM SALES BY TOTAL SALES AS 'TOT_SALES' BY COUNTRY ON TABLE HOLD AS SALES ON TABLE SET ASNAMES ON END TABLE FILE SALES PRINT SALES COMPUTE RNK_NBR/I2 = LAST RNK_NBR + 1; NOPRINT BY HIGHEST TOT_SALES NOPRINT BY COUNTRY ON TABLE SET STYLE * $ TYPE=DATA, WHEN=RNK_NBR EQ 1, COLOR='RED', STYLE='BOLD', $ ENDSTYLE END
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now