I have two columns on a table (List) which has the following
List Table (Input)
Output:
Moreover; I want to create a donut chart to get the output count of specific ERP: Xero and count the rest as 1 so it will be XERO/The Rest of ERP.
Use Advanced groupby option in power query like below.
Note you should select both the columns by holding control key.
Related
I'm working with the Snap SPARQL tool in Protege so to add data into the ontology I have to use CONSTRUCT because it doesn't support INSERT (the tool gives the option to assert the new triples constructed back into the ontology). I want to count values with a specific value and assert the count of those values back into the ontology. I created a little test ontology regarding students and grades to help me figure this out. I have the following query which works:
SELECT ?student (COUNT(?test) AS ?tcount)
WHERE {?student test:tookTest ?test.
?test test:hasGrade test:A.}
GROUP BY ?student
This gives me a table with each student in one column and their number of A grades in the next. What I want to do next is to use the ?tcount to assert the data back into the ontology. I've tried various things like replacing the SELECT with a CONSTRUCT or using an embedded query:
CONSTRUCT {?student test:hasACount ?tcount.}
WHERE {
SELECT ?student (COUNT(?test) AS ?tcount)
WHERE {?student test:tookTest ?test.
?test test:hasGrade test:A.}
GROUP BY ?student}
I think the problem with this is that ?tcount isn't in scope of the surrounding query. I've tried several different options like using BIND to BIND ?tcount or grouping by ?tcount rather than ?student but no luck.
We have a table students with ID,NAME,SURNAME. We want have another table (created) students_2 with ID1,NAME1,SURNAME1.
Starting from table students, i want to fill data in the second table in the following way : I want to have in the second table combinations of names ( example : NAME,SURNAME1; NAME1,SURNAME1). Moreover, i want to generate combination of names.
How can I do that ? I tried something like :
INSERT INTO students_2 (ID1,NAME1,SURNAME1) SELECT ID,NAME,NAME from students;
But it's not correct cause I don't generate combinations, just inserting . A solution is appreciated, but mainly i need ideas.
You could write something like
INSERT INTO students2(NAME, VALUE) FROM
SELECT s1.name, s2.value from students1 s1 cross join students1 s2
This will do Cartesian product , and will get a NxN rows with combinations
I am using Dojo DataGrid with dojo 'AndOrReadStore' so that I can use complex queries on column data.
I have a column, say DocumentTypeIds, in dojo DataGrid that shows comma seperated string of type ids of a document for each document row. Lets say its value is '5, 6' among 20 different possible values. These document types are further categorized into 3 categories: A, B, C. for example
Document Type/name | A B C
---------------------------
5 / finance report | 1 0 0
6 / summary report | 0 1 0
Based on choice of A, B and C, I want to filter documents in the grid. For example if user chose C and document type ids are '5,6' then I do not want to filter this document. I can filter the possible document type ids based on category in an array that I want to compare this column against. Lets assume the possible values after choosing option C are [8, 9, 2, 99] then my filtering condition needs to be
[5,6] in [8,9,2,99]
or
'5,6' in '8,9,2,99'
The problem with first approach is that column values are in CSV format so i dont think i can convert those into array in query. The problem with second approach is that i dont want to find string '5,6' in '8,9,2,99' rather i want to find if both '5' and '6' exist in the '8,9,2,99' and they may not appear next to each other in '8,9,2,99'.
I don't know how to approach this problem as it is very important for me to filter the rows at client side because I want to bring in all rows and let user choose what type of documents they want to see.
grid.filter({complexQuery: "DocumentTypeIds: ? "});
I appreciate any help.
Thanks
I've two Views using Table Summarize to count their rows. One view is student arrivals and the other is studen departures.
I want to subtract the row count in ViewB (departures) from ViewA (arrivals) and combine them into a net figure. Perhaps combine in another view.
I am aware of union as a tool for merging but I don't want to combine the result set, I only want to subtract the row counts.
Any suggestions much appreciated!
Is it possible to add more than one measure in a single crosstab?
I have a crosstab in which rows represent departments and columns represent gender. It is possible to display counts and percentages?
I am reporting from relational data.
Yes. You can add multiple measures to your crosstab by nesting them in either rows or columns.
In your example, nest Counts and Percentages under Departments row or Gender Column.
Given below is an example of displaying two measures Revenue and Quantity in a crosstab.
The result looks like this:
Please refer to IBM Infocenter for more details on nested Crosstab.
http://publib.boulder.ibm.com/infocenter/c8bi/v8r4m0/index.jsp