hello everyone,
does anyone has an idea how i can get the right result for this one? I have a table with Completed, In Progress and New projects. I want to create a Pie Chart that will show only the On/Off Track In Progress and New projects. So far, all my attempts always include even the Completed projects.
Appreciate everyone's help here. thank you. 🙂
Solved! Go to Solution.
I used a different approach and created a few collections to prepare my data for the chart. of course you can combine some of the steps but I'm gonna put them all here so we can track them easier. I created an excel sheet similar to yours, and on the App Start I did the following:
Then I set the items of my chart to colMyChartSource. and here is the result:
-----------------------------------------------------------------------------------
Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!
So you have a pie chart in your canvas app, and it reads the data from an excel table? you need to use the Filter function on your datasource to exclude completed projects.
Items: Filter(yourExcelDataSource, Status <> "Completed")
i thought it was that easy too, here are some more info from what I am currently working on:
i have a screen with this code in the OnVisible:
Clear(OnTrack_C);
Clear(OffTrack_C);
ForAll(
Project_Tracker,
If("On_Off_Track" = "On Track",Collect(OnTrack_C,1));
If("On_Off_Track" = "Off Track",Collect(OffTrack_C,1))
);
ClearCollect(
PieDataTrack,
{Stats: "OnTrack", Count_P: CountRows(OnTrack_C)},
{Stats: "OffTrack" ,Count_P: CountRows(OffTrack_C)}
)
Then in my Pie Chart Items, I got this:
AddColumns(AddColumns(GroupBy(Project_Tracker, "On_Off_Track", "ProjectTracker"), "TrackerCount", CountRows(ProjectTracker)), "TrackLabel", Text(CountRows(ProjectTracker)/Value(Textbox.Text)*100, "[$-en-US]%#.00"))
I did try your suggestion before I posted this, it looked like this, but the chart is still not correct:
AddColumns(AddColumns(GroupBy(Filter(Project_Tracker, Status1.Value = "In Progress"), "On_Off_Track", "ProjectTracker"), "TrackerCount", CountRows(ProjectTracker)), "TrackLabel", Text(CountRows(ProjectTracker)/Value(Textbox.Text)*100, "[$-en-US]%#.00"))
I used a different approach and created a few collections to prepare my data for the chart. of course you can combine some of the steps but I'm gonna put them all here so we can track them easier. I created an excel sheet similar to yours, and on the App Start I did the following:
Then I set the items of my chart to colMyChartSource. and here is the result:
-----------------------------------------------------------------------------------
Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!
hi @Edwin-Abdalian, the fact that you're taking time to help me already deserves a thumbs up. 🙂
I believe, the solution you provided works just fine, I tried applying this to a Sharepoint list though, somehow, the pie chart is blank although there's no error in the script other than 'delegation' warning for '<>'.
Any thoughts how this can work for a SP list as well? Thanks again.
Thanks @ojack21 .could you share the schema of your SharePoint list?
I managed to figure it out! Thank you so much @Edwin-Abdalian, awesome support!
User | Count |
---|---|
132 | |
127 | |
74 | |
72 | |
70 |
User | Count |
---|---|
206 | |
200 | |
64 | |
63 | |
51 |