November 6, 20196 yr I have 2 fields that are used to create a simple Bar Chart layout: Customers and Sales. Each field is a list of values I have generated from summary reports using Mikhail Edoshin's Fast Summary technique. Each of the 2 fields contains many values (maybe up to 30 or 40 entries), sorted by Sales. I would like to chart the top 10 Customers (by Sales). How would I use a script to modify the data in each field to keep only the first (or last) 10 values? Thank you.
November 6, 20196 yr You could define your chart to use only: LeftValues ( Customers ; 10 ) for Category Labels and: LeftValues ( Sales ; 10 ) for Slice Data. Note: If you're running Fast Summaries only to produce this chart, and you know in advance that you only want the top 10, it might be smarter to modify the script to exit after the 10th group.
November 6, 20196 yr Author Thanks for the reply. I went with the option to modify the script to exit after the 10th group. To do this I sort by descending order, according to Sales. This works well but will gives me the largest Sales values first. When I chart this as a Bar chart the largest values are on the bottom of the chart. I would prefer the largest to be at the top. I'm not sure how to do this using the Fast Summaries method because the number of Customers will vary. I'm not sure how to start collecting values from the last 10 groups if I were to sort in ascending order. Should I try and work out how to collect the values from the last 10 groups, or should I attempt to reorder the list in the delimited field? Is there another method I should use? Thanks again.
November 6, 20196 yr If your records are sorted by Sales, descending, and you are starting from the first (i.e. the largest) group, then you are collecting the values in the order you want them. If the result is in reverse order, it is probably due to your script placing each value at the head of the collected list, instead of at the tail.
November 6, 20196 yr Author Thanks very much. That was so simple! The answer is sometimes right in front of me - I appreciate you pointing it out.
Create an account or sign in to comment