Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone. I'm trying to figure out how I should approach creating an object that allows the user to pick which records to compare in a table. For example let's say I have a table like this:
Our Products | Our Sales |
| Competitor Sales | Sales Difference | |
---|---|---|---|---|---|
OP1 | 100 | CP1 | 90 | 10 | |
OP2 | 50 | CP2 | 75 | -25 | |
OP3 | 25 | CP3 | 25 | 0 |
Here the differences are taken by OP1 - CP1, OP2 - CP2, and so on. What I want is for the user to be able to see the Sales Difference of OP1 - CP3 or OP2 - CP1, etc according to their designation of which products to compare against. I don't know if there's a way to have picklists or something and a table that recognizes those records as the ones to compare... Any suggestions on where to begin, what functions and object types to use, etc would be greatly appreciated!
In case anyone finds this, here's what I did:
Originally in my script, Our Products and Competitor Products existed in the same concatenated table from two sources, which is where my question originated from because I wasn't sure how to split 1 field into 2 columns in an object. What I had to do was keep those two sources separate, i.e. have two tables for both product categories with all uniquely named fields. For example instead of just Sales there is now OurSales and CompetitorSales. My table structure now looks like two separate structures with unique fields. Then I could build a chart that compares the two types of products (ours vs competitors).
In order for the user to pick what to compare without showing every possible combination of our products to competitor products, I decided to have the designations pull from a Google spreadsheet with two columns: Our Products and Competitor Products where my boss can choose what that table should default to. Then I created another table with a flag for those combos so that when the flag filter is activated in the app, the chart will reflect the pairings in the Google doc.
Best of luck to those attempting something similar!
use Alternate States
How many distinct Dimension value you have like now it's 3.
And also are they dynamic
About 15 distinct dimension values for Our Products and 15 for Competitor Products, so 30 total. Not sure what you mean by dynamic, but the products are pretty much set with an occasional product being added once a month or so.
I may be oversimplifying but maybe this?
This is great! If I wanted each OP to be paired with only one CP and vice versa, do you know how I'd approach that? The table in your example returns each combination, but what if the user only wants to see one-to-one according to their selection, for example OP1 to CP2 and OP2 to CP3, but excluding all the other combinations of products.
In case anyone finds this, here's what I did:
Originally in my script, Our Products and Competitor Products existed in the same concatenated table from two sources, which is where my question originated from because I wasn't sure how to split 1 field into 2 columns in an object. What I had to do was keep those two sources separate, i.e. have two tables for both product categories with all uniquely named fields. For example instead of just Sales there is now OurSales and CompetitorSales. My table structure now looks like two separate structures with unique fields. Then I could build a chart that compares the two types of products (ours vs competitors).
In order for the user to pick what to compare without showing every possible combination of our products to competitor products, I decided to have the designations pull from a Google spreadsheet with two columns: Our Products and Competitor Products where my boss can choose what that table should default to. Then I created another table with a flag for those combos so that when the flag filter is activated in the app, the chart will reflect the pairings in the Google doc.
Best of luck to those attempting something similar!