How to hide some size option from size swatches? - magento2

I have not programmatical experience, especially in magento2.
I wanted to hide some size options from size swatches on the product details page based on category.
Detail Issue Explanation:
Suppose I have a configurable product XYZ and it has 25,26,30,34,36,38,4 size option. and product falling in category A and category B. Now i wanted to hide size option < 36 size if user going through category B on product XYZ .
Note: Product XYZ is only one product and falling in two category.
Please provide the solution where and what i have to do.
Thanks in advance.

Related

Tableau subtotal in graph

I am trying to make a graph/chart of showing a measure category-wise. The categories are further subdivided into sub-categories and these sub-category has also been added in the view.
What I am trying to achieve is to include category wise measure sub-total in the view but as a label only. If I am adding sub-totals from analysis pane, another bar is added which I do not want. I only want that these sub-total values be displayed as a label under each category.
How should I proceed?
For this purpose sample superstore data on tableau may be considered.
I have done some workaround to show it like this.
step-1 added a desired 'sub-total' field like this (Sample -superstore data in tableau)
{Fixed [Category]: SUM([Sales])}
Created a view thereafter like this, which in my opinion should serve your purpose

Graph based on the user filter selection

On a tableau dashboard there are 2 filters and a bar graph.
The filters are 1. to select top or bottom customers
2. how many ex:5,10,15 etc
when the user selects top and 5 in the respective filters then top5 customers have to show in the bar graph.
if the user selects bottom ,10 in the respective filters then bottom 10 customers have to shown in the graph.
how to achieve this when the data contains only customers details and their billing amount ?
Instead of filter, you can go with the Parameter for getting the result. I have done the top and bottom multiple times in many of the tableau visualizations and its so easy.
Below are the steps to achieve your requirement.
Create a parameter that will allow you to select top and bottom
Create another parameter that will allow you to select the desired numbers like 5, 10, 15 etc.
Here i have created a parameter that will have values from 10 to 50 in a step size of 10.
Create a calculated field that will subset data based on the parameters chosen
In the above screenshot, I am using the top site parameter and creating a conditional statement that will show the states based on the value chosen in the site parameter and the value for that state.
Put the calculated field in the filter and select show and click ok in the filter box.
Now the view will show the top count based on the value selected in the parameter.
Please note the calculation is for top N and for bottom N you need to change the calculation.
Hope this will help you. I can provide you a workbook if you need.

Showing comparison across groups in tooltip Tableau

I have a dashboard that lets users compare a company selected from a drop down menu (Company A) to another company chosen from another drop down menu (Company B). This then displays stacked bar charts (5 categories) by year. I want to build a tooltip so that when the user hovers over one of the 5 categories in either set of bar charts, it shows a comparison of that category between Company A and Company B. Is this possible, and if so, what is the best way to do this?
My previous answer showed a different approach for the problem without using too many workarounds. This answer will try to give exactly what has been asked.
First thing to understand is that you can't have the values for two different companies if you're filtering to show only one company. That means you'll need to circumvent this by filtering directly on the field.
Step 1: Create the new parameters that will be used as filters.
You want to create two parameters called "Company 1" and "Company 2" that will be used in each view to filter the company on the graphic.
Step 2: Create the new measures with the filter directly in the field.
Now you should create two new measures from your main measure, each one filtering one of the companies accordingly to the parameter, e.g. Sales Company 1 and Sales Company 2.
Step 3: Create a field with the variation and add it at the tooltip mark.
Simply enough, you want a calculated field with the difference between them:
SUM([Sales C1]) - SUM([Sales C2])
Step 4: Update the views and dashboard
Change the measure in each of the views for their following specific measure field, and remove the Company filter. And in the dashboard, substitute your usual filters to the parameter (which will be used to filter both views).
By assuming you have a dashboard with two views, you'll be filtering the [Company] in both of these views, making the value of another company not available to be shown at the tooltip.
If you're not using it yet, you could try a new approach and see the variance between companies by using the Color mark. By adding the [Company] as color, you could turn the Stack Marks off and add the second company in the filter to be able to visualize the difference.

Tableau, color-coded bar chart not working

Public workbook here. Source is Excel file.
I was able to create ordered bar chart based on (1) Location (2) Product
When I drag Above Three into Color, the graph is incorrect, how to troubleshoot?
Update
I made change such that Calculation computers based on Product, Above Three for each Location, at level Product.
However, Morton's still shows error.
The order in Mortons should descend, based on number of records, i.e.
Dark Chocolate
Beer
Toffee
Coffee
Fries
Rest of the Locations are correct, but only Mortons gives out-of-order products
Update2
Calculated Field Calculation3 = Index()
And I filter Calculation3 for 1 to 3, to display top 3 products
If I remove Calculation3 from filter, it gives correct order but it give ALL products, not the top three popular products (per Location).
I updated workbook to illustrate this. Please advise.
I don't know the purpose of the Index() field but that is creating your issue. Remove it from rows and the color appears to work the way you want it.
I hope this is what you are looking for
I have also published the file at the below address. You can take a view on that.
Tableau Wokbook
I achieved it by the following methods.
I changed the Calculation 3 field from Index() to RANK(SUM(NUMBER OF RECORDS)).
The calculation 3 was kept in between Location and period then edited the table calculation of calculation 3 by keeping the Addressing of the edit table calculation, having only the location and product as shown below and then Set the restarting every to Product.
You can check the workbook for more information

Dynamically resize if hiding rows conditional in SSRS report

I'm working on a report which displays a configuration for a product, which depending on the product choosen has specific properties. I thought it would be handy to have one rectangle with a table on the left (tblDetailsB) and one on the right side of the report (tblDetailsA) (don't mind the order of A and B here...).
Under the rectangle I have another table which shows a list of drawers (if they're part of the configuration), this list comes from another dataset.
My problem is the size of the rectangle which holds tblDetailA and tlbDetailB is fixed (that's usually why one chooses a rectangle to hold..) and my tlbLade subreport for the drawers is under a lot of whitespace..
I could use subreports for tblDetailsA and tblDetailsB but I don't want to have too many of them..
I got myself into this mess, maybe someone knows a much better idea to solve this?
Thanks to http://www.sqldev.org/sql-server-reporting-services/hidden-rows-still-displayed-9660.shtml
I found out I have to suppress / hide the rows in the static row group under the details group (switch to advanced mode first..).
When I did that the size of the Rectangle (container) was ignored when the rows where hidden :)
Regards,
Mike