How to construct Multiple variable barplot in r studio for the following data Table - bar-chart

Two way table showing BMI
Need a barplot like this for the above table instead of "clarity" I want to put "Category"

Related

Microsoft Report Builder: How to display selected chosen values from a multi-value parameter in a table?

I'm using MS Report Builder v3.0 to create a report. As part of this report, I have a multi-valued parameter (named #Diagnoses). The labels and some of the values (truncated by the size of the display boxes) of this parameter are shown below:
What I would like to be able to do is display the labels / values the user chooses in a 2-column tablix (I've tried using separate textboxes for the labels / values but the results are mis-aligned).
However, this does not appear to be straightforward. The closest method I've found is this one, which stores the user's choices in an internal parameter in xml format, then queries this parameter to produce a dataset from the xml.
So, I created the xml-producing internal parameter like this:
...and I've created a dataset based on this data, with the following query:
But now when I put these values into a tablix, the labels and values are now on separate rows, like this:
Does anyone have a straightforward way of sorting this out?
Best Wishes
C J
OK - I've solved it (it's not pretty, but it works!)
Basically, the problem comes from having to use the join statement when creating the xml - you can't really put both the label information and the value information on the same row in the xml.
To get round this, you have to use two internal parameters to create two datasets - one for the labels column, one for the values column. The method for creating these is essentially the same as that shown above, except for the values parameter, the expression for the default value is:
...and for the labels parameter, it's this:
(by the way, make sure you set the available values to "None" for internal / hidden parameters - the expressions here are for the default values)
Then, when you create the values dataset, you use the following syntax in its query:
...and similarly for the labels dataset.
Finally, in the report, you create one matrix from each of the two datasets, then put them next to each other, using fixed row heights and setting "can shrink" / "can grow" to false so that they look like they're in the same table:
I hope this helps somebody!

How to split JSON columns in Power BI

I have imported JSON data from Hive database. The structure looks like the attached. JSON data has been dumped to Hive without normalizing. Is it possible to parse the data?. For example, in the attached image, the mentionedlocations column has some places mentioned and I want them to be in separate rows.
You can use the Json.Document function to read the column as JSON.
I'd suggest creating a custom column with this formula:
Record.ToTable(Json.Document([mentionedlocations]))
and then expanding that column to get the multiple rows you want.
Putting these together:
= Table.ExpandTableColumn(
Table.AddColumn(PreviousStep, "Custom",
each Record.ToTable(Json.Document([mentionedlocations]))),
"Custom", {"Name"}, {"locations"})
This takes the PreviousStep in the query, adds a Custom column which converts the JSON text into a table and then expands the Name column in each of the tables in the Custom column and renames the column locations.
More easy peasy:
Right click on the column > Transform > JSON
Now use the button at the top right of the same column and Power BI is going to use the JSON element as the column name

ReportItems when using two tables on a single report

I have two tablix tables on a report, which are using the same dataset. I'm trying to display some data from the table in a separate textbox area above the table. The data in the tables shows fine, but the textbox values are blank.
Is there something special regarding the "scope" of reportitems regarding the values that would be displayed in the textboxes?
The layout is something like this
textbox1 = ReportItems!MerchantCode.Value
Table A <br/>
MerchantCode
< page break >
textbox1 = ReportItems!MerchantCode1.Value
Table B <br/>
MerchantCode1
[ update ]
What I did to resolve this, was replace the "extra" textboxes ABOVE the table(s), with extra row WITHIN the table, then using expressions that reference fields of the dataset, rather than textbox values. Still wondering however, why the the values with the table will display but referencing that textbox from OUTSIDE the table results in an empty value.
You should use dataset name in the expression.
e.g.:
=First(Fields!MerchantCode.Value, "Dataset1")

Display data in single column

I have a table as shown below:
Table 1
I need to display data like below. I have tried using grouping but but i failed.
I have read some topics but can't find the solution. This should not be that hard.
Table 2
You can get that using LookupSet over a dumb group.
Add a tablix to your report and add a parent group in the Row Groups pane.
Use the below expression to create the group.
=1
That expression will create only one group, and you will have something like this in design.
Then use this expression in the highlighted cell in my screenshot above.
=join(
LookupSet(1,1,Fields!ColumnA.Value,"DataSetName")," - ")
Where Fields!ColumnA.Value is the field of X, Y and Z values, and DataSetName should be the name of your dataset.
You will get this result.
If you have repeated values in ColumnA they will appear repeated too in the cell. You will have to filter your dataset to get only unique values.

SSRS Graphing multiple lines using each column from database as x-axis

I can seem to figure out what how to set up a way to graph the following table into a graph with multiple lines. I have the following table:
I would like each row of the SRReportName be a different line and each column from ProcessingMinsYesterday and the rest (not SRReportName column) to be an value in the X-axis and the Y-axis to be that numerical value within the tables. So it would look like this:
You can represent each report by a line in the chart, just add SSRSReportName to the Series pane. However to get the desired x-axis you have to unpivot your ProcessingMins columns from the query.