If I have a customer and orders tables, how can I add one or more charts to the customer detail view that will show data from the orders table for same customer?
@_Excelrati
To the table where Customer information is coming from, add a Virtual Column with a SELECT(โฆ) expression to populate which data you want from any desired table which will create a LIST type virtual column. Then create a REF type Chart View associated with this Virtual Column. Edit Customer Detail view and arrange the column order including this virtual column. Your chart(s) will be shown as an inline view in Customer Detail View.
Hi, Iโm new in appsheet and I canโt get the SELECT() expression to work. I need to make a pie chart with percent values from 6 diferent columns. What Iโm trying to show is a golf player stroke statistic. When you click the players name the chart have to show the storke distribution. But I cant get it to work.
Thanks
Hi @PGT_GOLF_TOUR! Welcome to the forum!
SELECT expressions can be tricky until you get used to them.
It will be easier for people here to help you if you can give us the table and column names your expression needs to access and then show us the expression youโve tried. Once we can determine that the expression is good, if that doesnโt solve the problem we can go to the next step.
Thank you Kirk for your answer,
The table name is STATS, ande columns the the expression need to acces are BIRDIES, PARES, BOGEY, 2 BOGEY, 3 BOGEY and 4+ BOGEY.
Iโve tried SELECT([BIRDIES],[PARES],[BOGEY],โฆ)
Also tried SELECT(stats[BIRDIES], ([_THISROW].[PALYERS] = [PLAYERS]))
Thanks
Thabk you Steve,
Iโve read that before I post my question. Sorry but I donโt get it how to get the data for the chart.
Thanks! I think that @Steve posted the link to the SELECT() article because your expressions donโt follow the format described in that article. Iโm not sure what you were trying to do with the first expression but in regard to the second one, hereโs a similar one in the SELECT() article:
SELECT(Orders[Order ID], ([Customer] = [_THISROW].[Customer]))
We can just modify this with your table and column names:
SELECT(STATS[BIRDIES], ([PLAYERS] = [_THISROW].[PLAYERS]))
This is quite similar to what you posted but you seem to have had a spelling mistake. When you use this expression, do you get an error?
By the way, this expression will produce a โlistโ of the information in the BIRDIES column for the player of this row. You said you are interested in making a pie chart. The select expression alone wonโt do that. I havenโt made a chart in a while but I think youโll need to first figure out how to calculate the values that will be displayed in the chart and then, when thatโs done, you can go to the next step of publishing the data in pie chart format. To do this, you might what to use what are called โvirtual columnsโ to prepare your data.
Hi Levent, iโm having trouble makeing this work, iโve followed the steps you gave and the graph isnโt shown.
Could you tell me what am I doing wrong?
Thanks.
You canโt see it as an inline view unless you donโt retrieve the key column values with the SELECT. I donโt know whatโs your expression in that VC, but I suspect your are collecting some kinda numbers
Thanks Levent, I did what you told. But now the graph is taking the whole detail view.
I deleted the graph ref view to show how it should be.
This view should be looking like this:
Have you created a new REF type CHART VIEW? How have you arranged that chart view?
Yes, a new REF type CHART VIEW:
It is appearing in the inline view but I added the column in the column order of the detail view.
Yes thatโs right, and that is what Iโm trying to do. I first read what @LeventK had explained in this post, I created the virtaul column, and he suggest to use a SELECT() expression to populate the data I need from the table. Well Iโm stuck there.
Thank you for your responses, and sorry for my ignorance in this matter.
What would you like to have in your pie chart? Perhaps if we start with the result you are aiming for, we can work backwards
By the way,I think that the select expression could be used to make a pie chart where we show what portion of all of the birdies the person of this record got. But, I doubt thatโs what you want to do.
Kirk, thank you for your reply.
What Iโm trying to do is to show in a chart, how many birdies, pars, bogeys, etc made each player. I have a table named STATS that has all the players in the tournament, with diferent information, and the last 7 columns (percent type) are the ones to use for the chart.
In that case, I think the
SELECT(STATS[BIRDIES], ([PLAYERS] = [_THISROW].[PLAYERS]))
should be useful to you. If you put it inside a COUNT() expression, you can count the number of birdies that player got:
COUNT(SELECT(STATS[BIRDIES], ([PLAYERS] = [_THISROW].[PLAYERS])))
I would recommend that this be in a virtual column. Then make similar virtual columns for every type of data (pars, bogeys, etc.). Then, the final task will be to put them together in a graph. Before the graph, though, youโll need to test to make sure that each vitural column is spitting out the correct calculation.
User | Count |
---|---|
41 | |
36 | |
30 | |
23 | |
16 |