Report Services sort column chart - reporting-services

I have a report containing a regular column chart that groups on product (column A) and the chart column values are the sums of the cost (column B). By default these are sorted alphabetically on the product string. I want it to sort the column values by default and then I would like to provide and option for the user to be able to switch between product name and column value. How do I do this?
Thanks

You can use a Sort By report parameter of Text type.
Set the Available Values and Default Values as follows :-
In the Column Chart, add an expression in the Sorting property of Category Group
Assuming you have the column values column as ColumnValue and Product Name column as ProductName then the expression should be :-
=iif(Parameters!SortBy.Value = "ColumnValues",Sum(Fields!ColumnValue.Value),Fields!ProductName.Value)

Related

Is it possible to create a MYSQL view where a single field could be populated from two different fields in a table based on a condition?

I am trying to create a View using certain fields from a single MYSQL table. But in one of the fields in the Table, I need to populate the field from either one field in the table or another field in the same table based on the value of a third field in the table. Is this possible, and if so, how?
To explain, The table contains data from two suppliers. The entries in the table from "Supplier A" store the Account Number in field CustomerNumber while the entries in the table from "Supplier B" store the Account Number in field CustomerAcct. The view I need to generate needs to list all of the customer orders from both suppliers combined, and populate a single field in the view called AccountNumber with either the value from CustoomerNumber or CustomerAcct, depending on which supplier filled the order.
Is this possible?
You'd use the "case" function, as in mysql case
CASE
WHEN Supplier = 'A' THEN customernumber
ELSE customeraccount
END as accountnumber

Need Column Name from input table in SSIS variable

I am using SSIS to import data from an Access database created by another department. It is weekly data, and one column is named [weeknum]_Sales - where each week the name of this column changes (201810_Sales, 201811_Sales, etc.) I am mapping that column (by position) to column in my db (Sales) but I need to put "weeknum" in another column.
Basically, their database is aggregating sales by item, and has this week's total (table has all items but only one week), but my db has years of data.
Their table (in Access)
Store, UPC, Sales, Units.....
My table:
Store, WeekNum, UPC, Sales, Units....
So I need to "retrieve" the left 6 characters of column name of column 3 (or 4) to a variable or expression before the SSIS Dataflow runs, and set column 3 of my table to that value for all rows inserted.
I know how to set the the destination column to a literal, expression or variable - but I don't know the specifics of how to get the column's name at run time of the SSIS package.
Thanks,

MS-Access: Replace values in column based on mapping list

I got a column with 27 thousand entries. I want to replace all occurences of "a" with "a_new", all occurences of "b" with "b_whatever". And so on. I got more than 1200 of these mappings. Can I somehow put my mappings into a list and feed it to MS-Access so that it replaces the values in a specific column?
Create new table with mapping - [OldValue] and [NewValue] columns, then join this table with your existing table by [OldValue] column and update by value from '[NewValue]`

SSRS report join datasets according parameter values

I have different dataset . Each for a country (USA,FRANCE,BRITAIN etc.) .
Also i have a Report multi value parameter to select country , so the report will show data only from the selected countries.
Several questions:
1. How can i join (merge) different datasets as described below?
2. I need to have a table in the report with the Country Column .
How about a table with separate tables for each country?
Create the table you want for a country (I'll C1 from here).
Create another table (T1) with cells the same width as C1. Delete the DATA row. Add a new row for your country. Merge the cells from the new row.
Put the headers from C1 on T1 and delete the header from C1. Put C1 into T1's single merged cell.
Copy C1 to create a new country and add a new line and repeat for all countries - changing the dataset for the new country.
Use the table row's visibility to show that country of not based on your parameter.
I think I've done this once a while back.

SQL get column name,row number of a unique value

I have got some SQL tables, and the structure of them can change. But there is always one unique value somewhere in a table (value's name is "Channel") and I always need to get the column name and the row number of this value in a current table ( to further get all values in this column with a row number greater as of "Channel") . How could the code for that look like?
Thanks,
Jeff