Focal Point
[SOLVED] Chart based on top 5 ranking, depending on filter criteria

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8447081886

October 30, 2017, 09:03 AM
SMW
[SOLVED] Chart based on top 5 ranking, depending on filter criteria
I went thru the forum discussion history, could not find this issue being discussed.

I am trying to build a graph with two filters:
Business Segment
Business subsegment

Data contains customer performance profitability performance.
Because the way the filters are set up, the same customer could show up twice if it exists in both subsegments under the segment.

I am trying to build a graph to show top 5 or could be top 10 customers volume and margin% based on the ranking of impact.

Is there anyone know how to make it work?
Thank you for your time!

This message has been edited. Last edited by: FP Mod Chuck,


Production WF 8.1, Test WF 8.2
Windows
HTML 5
October 30, 2017, 10:51 AM
MartinY
I don't think that your issue is with the filters, it looks like it's more a BY and RANKING issue.

Do you display you graph BY BUSINESS_SEGMENT and BY BUSINESS_SUBSEGMENT which result in having twice the same customer displayed ?

If you are displaying your graph by customer I don't think that twice the same customer will be displayed but since you are also ranking by the performance, if a customer has the same performance in two subsegment, it could be displayed twice.

But this can by affected the way your code is and data are. Without further detail is going to be difficult to give a proper answer.
Can you share your code and have more info on your data such as how it is organized (sample could help). Use code tag to display both code and data sample : the last icon on the ribbon
</>


As per below, some CAR are displayed more than once because they have several model with the same PERFO, but if BY MODEL is removed, then each car is displayed only once.

DEFINE FILE CAR
PERFO    /I2 = DECODE CAR ('ALFA ROMEO' 1
                           'AUDI'       2
                           'BMW'        3
                           'DATSUN'     1
                           'JAGUAR'     2
                           'JENSEN'     3
                           'MASERATI'   2
                           'PEUGEOT'    3
                           'TOYOTA'     2
                           'TRIUMPH'    2);
END
TABLE FILE CAR
PRINT PERFO
BY COUNTRY
BY CAR
BY MODEL
ON TABLE HOLD AS TMP FORMAT FOCUS
END
-RUN

TABLE FILE TMP
RANKED BY PERFO
BY MODEL
BY CAR
END
-RUN



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 30, 2017, 01:51 PM
Doug
Or: "BY HIGHEST 5 PERFO"
October 30, 2017, 03:02 PM
SMW
here is the screen print of my InfoAssist chart building:
Screen Print 1

This is the first time I post image on the Forum. Please let me know if you can see it.
Thank you.


Production WF 8.1, Test WF 8.2
Windows
HTML 5
October 30, 2017, 03:29 PM
MartinY
SMW,

What is the relation with your original post ? Where is the issue with your graph ?
This graph looks good for me.

I thought that your issue was :
"the same customer could show up twice if it exists in both subsegments under the segment."

But the above may not be an issue. As I showed in my sample, it is possible that a customer appears twice due to data and it could be ok.

As for "I am trying to build a graph to show top 5 or could be top 10 " once your performance is assigned, you can use Doug's sample to have the Top 5 or use RANKED (search in technical library).

Normally what I do prior to build a chart, is to extract the data as in a regular report to look at the result and see if it will provide what I'm looking for from a data point of view.

Can you elaborate ?


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 30, 2017, 03:34 PM
BSBAL18
Can a RANK also be done on a report with a count? So i have similar questions in regards to state/county where i have all my BY fields, and then a SUM CNT.items.

CAn i do a top 5 ranking on that CNT.ITEMS field based on two by fields of Year/Week and STATE. Output would be ...

Y-Week1,Illinois, county1, 50, 1
Y-Week1,Illinois, county4, 44, 2
Y-Week1,Illinois, county5, 41, 3
...
Y-Week1,Missouri, county1, 44, 1
...
Y-Week2, Illinois, county1, 22, 1
...


AS Version: 8201
Gen: 10202016
Windows, All Outputs
October 30, 2017, 03:48 PM
MartinY
quote:
Can a RANK also be done on a report with a count?

Try it BSBAL. Wink

What you may have to do is to perform your SUM CNT.field and HOLD the data to then use that new HOLD file as input to another report where you will RANK.

TABLE FILE CAR
SUM CNT.MODEL AS 'CNT_MOD'
BY COUNTRY
BY CAR
ON TABLE HOLD AS TMP FORMAT FOCUS
END
-RUN

TABLE FILE TMP
RANKED BY HIGHEST CNT_MOD
BY COUNTRY
BY CAR
END
-RUN

This message has been edited. Last edited by: MartinY,


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 30, 2017, 04:44 PM
Doug
SUM VS RANK: One will show dups if multiple BY fields have the same value. Check the manual to see which one does that and determine which you want to display.
October 30, 2017, 04:45 PM
SMW
Hi Marin,
My chart is total sales and margin for a specific business segment.

I need to set an additional filter that allows me to select top 5 or 10 impact customers.

I don't know how to set the filter. I can't seem to implement Doug's suggestion because the sort/rank file is grayed out.


Production WF 8.1, Test WF 8.2
Windows
HTML 5
October 30, 2017, 05:23 PM
Doug
Add a "ImpactCustomers" DEFAULTed Variable to the fex and then add it to your parm page with the selections either 5 or 10, then add it to your BY HIGHEST &ImpactCustomers [field name].
October 30, 2017, 05:43 PM
SMW
I was able to make the ranking in my Hold file. see attached image.

I believe I had tried it before, and ran into "unrecoverable error" message.

As suggested by Martin, I ran the report based on this setting, I noticed that I am not able to combine the same customers that show up in multiple sub-segments into one, when I use filter "segment" only.

Also, the filter does not allow flexibility of custom input, only the range defined by WF.

Did I explain myself clearly?




Production WF 8.1, Test WF 8.2
Windows
HTML 5
October 30, 2017, 05:46 PM
SMW
Ranking screen print

Image did not get attached to the last posting.


Production WF 8.1, Test WF 8.2
Windows
HTML 5
October 30, 2017, 05:52 PM
Doug
For simplicity: Get all your data into a single segment HOLD file (FORMAT FOCUS works best imho) and work from there.

For test and verification: Hard Code "BY HIGHEST 5 [field]", and '10' and run it.
October 30, 2017, 05:54 PM
SMW
this is the screen print of me trying to rank to the filter. It does not seem to work...

Impact Ranking trial


Production WF 8.1, Test WF 8.2
Windows
HTML 5
October 30, 2017, 06:06 PM
SMW
this is the coding...
Coding


Production WF 8.1, Test WF 8.2
Windows
HTML 5
October 30, 2017, 06:08 PM
SMW
It seems to be very hard to read Frowner

I don't know how to past it in as text without using URL


Production WF 8.1, Test WF 8.2
Windows
HTML 5
October 30, 2017, 06:41 PM
Doug
Just a FocalPoint Tip: Please try to keep your replies to a single post. The previous one should be a single post.

Smiler Doug
October 31, 2017, 08:47 AM
MartinY
quote:
I don't know how to past it in as text without using URL


Use the code tag (right most icon on ribbon)
</>


Or in your tread type (without the spaces between [ and c) :
[ code] "paste or type here your code" [/ code]


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 31, 2017, 09:25 AM
SMW
thanks Doug!
New kid on the block will not repeat the same mistake Smiler


Production WF 8.1, Test WF 8.2
Windows
HTML 5