Adding a chart on detail view

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?

0 17 2,200
  • UX
17 REPLIES 17

@_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.


The graph should appear at the bottom of the Detail view

I deleted the graph ref view to show how it should be.
This view should be looking like this:


And the detail view like this:

The graph should be at the bottom of the detail view where those Key numbers appear.

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.

Top Labels in this Space