Hello good people of Power Community.
It's getting late, and I have used way to much time allready, so hope someone can help me out.
Im looking for a clever way to count the number of reports and display it as a piechart
I have a category list with 4 categories (but it can be as many as the user like)
I have a report list with HSEQ reports that has one of the category listetd i Category list.
I tried as follow:
Clear(_dataResult);;
ClearCollect(
_dataKlassifiseringer;
LVL_HSEQ_Klassifisering
);;
ClearCollect(
_dataRapporter;
LVL_Kvalitet_Forbedring
);;
ForAll(
_dataKlassifiseringer;
Collect(
_dataResult;
{
ID:ID;
Title:Title;
Antall: CountIf(LVL_Kvalitet_Forbedring;klassifiseringsID=ID)
}
)
)
I have tried CountRows(Filter(....)), with same result, allways 1 for each item. The result is as follow:
Column 3 is the Antall from code above. Column 4 is coded in a textbox inside the gallery and give me the correct result I want, but its useless when its calculated inside the gallery. All these codes should run in the background onVisible or onStart and display a graph on the dashbord for the user.
Any help, tip or alternative methods is greatly appreciated.
Best Regards
Tommy
Solved! Go to Solution.
You will need to shape your data in the Items property.
Something like this:
ShowColumns(
AddColumns(
Gallery22.AllItems,
"_antall", Value(theNameOfTheTextBoxInYourGallery.Text)
),
"Title",
"_antall"
)
This will provide a table of records with a Title (for Labels) and a _antall (for Series) to the Items of your pie chart.
So you mention that it is useless in the Gallery...why is that?
You can have your graph get its data from that Gallery if you already have the values there that you want.
In other words, there is no need for all of these collections if you already have the values you want in your Gallery...the Gallery is already a table.
I hope this is helpful for you.
Hi RandyHayes
Thanks for reply :).
That was my second plan, but they are not available as series in the pie chart. Maybe I'm doing something wrong here?:
I tried textbox and input box, but they are not recognised. Maybe I can patch the gallery to a table or something.
What I would like to know is, if it is impossible to to anything like I initially tried to or not. If its not possible I can use time to try to make a gallery and patch it to a collection in the background.
Best regards
Tommy
You will need to shape your data in the Items property.
Something like this:
ShowColumns(
AddColumns(
Gallery22.AllItems,
"_antall", Value(theNameOfTheTextBoxInYourGallery.Text)
),
"Title",
"_antall"
)
This will provide a table of records with a Title (for Labels) and a _antall (for Series) to the Items of your pie chart.