SSRS: Static Rows and Columns - reporting-services

I am new to SSRS and Stuck in a situation where I need to display the Data.
I want to show data with static rows and columns as shown below
Is there a way I can set the static rows and columns in the ssrs.

You can create a regular tablix connected to your data source
Then you can add as many columns as required
In the end it can look like this with a better coloring/font etc.

What you can do is to create a query which returns 64 rows and 3 columns:
Column A : "Row 1", "Row 2"...."Row 8"
Column B : "Column 1", "Column 2", "Column3" ..."Column 8"
Column C : Data
Then Create a Matrix, with A in Row and B in Column and C in Data.
Basically, Column A and Column B will be a shell which holds the data, then left join with the data to form your full data set.

Related

SQL Query on replacing element

I am trying to write a SQL Query. I have 2 tables. Table 1(left table) and Table 2(right table). I want to do a left join. So If a Group in table 1 is found in table 2, we replace it with New Group.
Table 2 has all PRIME Group. There are 2 conditions:
If a PRIME (or) SEMIPRIME is there in table 1, we lookup in table 2 and replace group with new group if found.
If a PRIME is there in table 1,and does not exist in NewGroup(Table2) we omit that group itself.(highlighted in yellow).
I tried using coalesce(y.Newgroup,x.Group), but how do I include 2 conditions?
Please refer input tables and expected output here
I created table here: https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=f019fb942f3aae3d62427a0ac142d639

how can I use Count distinct function for column A and add a condition of sum for column B

I have a table where column A is "id" and column B is "State" as these columns are in relation ship with other table the values get repeated, but I want to calculate distinct "id" with State their which are fixed(Like deliverd, not delivered, Inprocess). But I am not able to get the count in table. Though I can do that in a chart but it needs to be shown in table.

Splitting column into two columns with different string counts in MySQL

I have a table ML, with column Klubs:
I want to split this column so I have two columns like this. New table name ML2 and column name Region.
First column can have 2 words if they are different from 2nd column word.
I am new to MySQL and searched all over stackoverflow and internet , but no luck.
How can split column Klubs from table ML as in 1st picture into new table ML2 with 2 columns as in 2nd picture?
Assuming that your second column does not include any spaces, we can search for the location of the last space, and then split there:
SELECT Klubs,
substr(Klubs, 1, char_length(Klubs) - instr(reverse(Klubs),' ')) as Region,
substr(Klubs, char_length(Klubs) - instr(reverse(Klubs),' ')+2) as Club
FROM ML;
I search for the the space with instr, and to do this reverse I use the reverse function on the string first, and then to compensate I subtract it from the length of the string with char_length.
You could insert it in a new table (ML2):
create table ML2
<the query>
or create a view:
create view ML2 as
<the query>

sql join 2 tables on column x and merge field z

lets take an example - i have 2 data tables, table "books" with columns "shelfId" and "text", and table "shelves" with column "Id". I want to join these two tables on books.shelfId == shelves.Id, and as a result, i want to see a new table with 2 columns - column 1 has unique values of Ids, and column 2 has merged values of books.text with same books.shelfId values and separated by comma or something else, i.e. :
Is it possible to write such sql select to get what i need ?
Here is fiddle http://sqlfiddle.com/#!2/c96dfa/1
SELECT shelfid as id, GROUP_CONCAT(text) AS text
FROM books
GROUP BY shelfid

How to get a record from two columns

I have a table name Vouchers in which i have three columns named "GroupName","LedgerName" and "Amount".
I have another Table named Accounts in which i have two columns "Name" and "Amount", now i want the column "Name" to have the the GroupName from the Vouchers Table and then all the LedgerName that have same GroupName to fall under that Record. The images explain my question asked above
Isn't this ORDER BY operation??
I don't think you can get your result in that format. But using ORDER BY operation you can get a similar output but with an extra column. :)