I want to do a simple POC for my team with a bar chart. I can write my SQL results to a table, but I want to see them in a Bar Chart but it displays nothing because of my bad syntax.
The table from st.write shows exactly what I want, only those 2 columns. The bar chart shows nothing.
Google has not been my friend! But I am sure this community can point me in the right direction!
Thanks!
SQL_Query:
select sum(registrant_id) as reg, created_at::date from domo_dev.lk_training.registrants group by created_at::date order by 2 limit 100’
As mentioned above, ‘st.write(SQL_Query)’ displays the results as a table
first column looks like a row number, second is ‘reg’ and third is that created at date.
Sorry for not including the SQL the first time around!
My guess is that those column names are not recognized. What do you get when you build the dataframe just as df = pd.DataFrame(SQL_Query) ? Does st.dataframe(df) shows a non-empty table that way?
When I try ‘df = pd.DataFrame(SQL_Query)’, then I see the correct results in my table.
Then I get this error:
streamlit.errors.StreamlitAPIException: reg (x parameter) was not found in the data columns or keys
UPDATE - I needed to capitalize the column names to match the table!
It works, thank you for the assistance !!!