Categorical Variable content in world map in tableau - variables

I have listed a sample data set. I need to get details of the different elements in the categorical variable over the map while hovering over the countries.
--Dragging and dropping the categorical variable just displays the values for the first element.
the variables used are:
country (geographic)
sales (numeric)
furniture (containing 'table' and 'chair')
I need to get details of sales of chairs and tables over the country on the map while hovering over the countries.
Thanks for the help
the sample data set as seen in the image

I would use the creating a graph in a tooltip hack to solve this problem. The issue is that the Level of Detail of your data does not support the visualisation you want to make.
Do the following:
1) Create cohort calculated fields: You need to separate a measure so that it is specific to one member in a dimension (basically a cross tab).
For you this means creating a calculated field per furniture type.
e.g. Chair Sales Cohort =
if [Furniture] = 'chair'
then [Sales]
END
Repeat this for each furniture type
You can then drag each of these onto the tooltip pane and you will have tooltips :)
If you wanted to get fancy follow step 2 and 3 from this link to make it a bar chart instead of just a number in a tooltip. make a bar chart in tableau
Good luck !

Related

How to Write a Variable for a Pie Chart with Multiple Fields in Qlik Sense

I am looking for some help in regards to writing a variable for a Pie Chart on my dashboard. I currently have the following variable for a KPI chart and this shows the latest weeks value but has the flexibility to change if a different week is selected.
=Sum({<week_date ={">=$(=Weekstart(max(week_date)))<=$(=Weekend(max(week_date)))"}>}total_calls)
Now for my pie chart, I want to show the different type of work that has been worked on during the week and this is through the 'source' column which has the following types. This will be my dimension(slice).
SOURCE
Calls
Email
Offline
The measure will show the number of 'touches' and is then displayed as a %. This works if I put the fields in, but I would like to write a variable so that it is dynamic but not sure how I do that.
Would appreciate any advice on how to move this forward.
UPDATES
I have the following values for the latest week (week ending) 21/02/2020:
Calls | 8,477
Email | 4,040
Offline | 9,052
and would like to show this in a Pie Chart. Currently I have managed to write the following definition:
=Sum({<[w_c.week_date] ={">=$(=Weekstart(max([w_c.week_date])))<=$(=Weekend(max([w_c.week_date])))"}>}[w_c.touches])
but I get a total instead of the individual sums for the Sources even though I have selected the SOURCE as the DIMENSION.
SOURCE | $(vVariable)
Calls | 21,569
Email | 21, 569
Offline | 21,569
Any ideas on how I can fix this?
I have added my table view as well as how I am able to get the figures manually if I select the source and week_date column as the dimension and the touches as the measure. If I filter for the latest week it shows me the volumes I want, but I would like this to work dynamically through the use of a variable. I have attached an image showing this, numbers will be different to the above as these have been updated.
I have managed to fix this by removing the "=" from my expression and this gave me the correct individual figures.
=Sum({<[w_c.week_date] =
to
Sum({<[w_c.week_date] = ...

QlikView: Displaying Charts in Grouped Style

I created a bar chart with 3 dimensions:
Year
Quarter
Senario
And I have one expression (Sum(Sales)).
Year, Quarter, and Scenario are displayed on the X axis.
The problem is Scenario bars is displayed in Stacked and not in Grouped style. In the Properties->Stlye->Subtype window, the Grouped and Stacked options are grayed out - the system does not allow me to choose either one of them.
How can I display Scenarios in Grouped stlye?
The problem seems to be QV cannot handle more than 2 dimensions without stacking.
I would suggest to either create a new dimension variable (for example Year & Quarter) so that you only have 2 dimension variables (Year&Quarter and Region):
Or to create a drill down group on Year -> Quarter.
In the end, I guess that it will be a matter of taste.
If you have 3 dimensions QlikView doesn't know which one to stack so removes the option.
So to solve this it groups the second dimension and stacks the 3rd
Example:
So if you switch the dimensions around I imagine you can get what you want. Unless you want Scenarios to stack and Quarters to stack, that is not possible , but I donn't know that the resultant graph would make sense.

Using Delphi TChart to display information from a database

I want to create a pie chart in Delphi that will show the user the number of people who play a specific sport.
The following SQL statements gets the information from the database and stores the number of people in a variable. The data type in the database is yes/no, so those who play a specific sport will have a tick and those who don't won't. The sql statement will determine how many people play a specific sport (if there is a tick in the database)
qry.sql.clear;
qry.sql.add('SELECT Count(tennis) AS [NoTennis] FROM [Sports] WHERE Tennis = True');
qry.Open;
iTennis := qry['NoTennis']; {integer variable}
This repeats for all the other sports, such as swimming, hockey, etc
Afterwards this data must be represented in the pie chart. I have the following code...
Chart1.Series[0].AddXY(iTennis, 1, 'Tennis', clTeeColor);
This also obviously repeats for all the other sports. But instead of displaying my data during run time, it still displays random data about keyboards and motorists, etc. To see what I am talking about click
(source: asiplease.net)
How do I get TChart to change it's data? Is it the SQL statement or adding the x and y values that is causing the problem?
You are showing a pie chart. The chart type is relevant how you add data to the chart. I remember thas AddXy was only for line-based chart. Try
Chart1.Series[0].Add(123, 'Tennis');
See steema documentation.
To clear previously generated values of the series, use
Chart1.Series[0].Clear();

Dependent filters in Webi report

I've created a webi report which displays a graph of Total revenue per day, Date is on X axis and Rev is on Y axis.
I've a requirement where the client wants to see it category and sub category wise in the same graph. I've used Filter Bar option and dragged Category. This works fine and displays the revenue for the selected category on a daily basis.
Now I added another filter Sub-Category which should display only the list of sub-categories associated with the Category selected but in turn displays all sub-categories irrespective of the category selected.
Is there a way to link those two filters?
Thanks,
Vijay
Hopefully It might be helpful to someone just in case...
I've created a custom navigation path in my business layer and used it in my webI.
Thanks,
Vijay
You can create another report sub_report to collect all categories and sub categories
Then you add this sub_report to master report by insert sub_report.

How to differentiate products depending on attributes in a Point of Sale Database Schema

Here is my dilemma, I am building a POS system for a pretty large retailer, they have different products which have different attributes (size, color, etc...).
When they receive the merchandise from the supplier they want to do their own labeling with their own UPC Bar Codes but they also want to differentiate between the different sizes using the code on the article.
Say they received Brand A shirts with 4 sizes S,M,L,XL then they should have different bar codes for each size.
So I thought of having a base code for the article and then concatenating numbers depending on the attributes to have different codes? and if no attributes are available just add 0s
I am storing the sizes and colors as attributes in the database as an (Entity-Attribute-Value). Is their a better way other than having to start concatenating numbers from the attributes to come up with the full code?
Thanks for your help!
edit-------------------------------------------------------
I am making the example a bit clearer
so the base code for the shirts is: 9 123456
Then for Color blue is: 789
and then for size S: 012
so the full code is 9 123456 789012
for another article that doesn't have size or color or actually any attribute
the base code would be 9 654321
plus 000000 for the attributes part
this is just for simplicity sake as I can use only one digit per attribute.
The other issue is when linking to the OrderDetails table I need to reference all the attributes to know that the customer actually bought Size S in Blue
One possible option is to create a table that stores the bar code as the key. Then have an attribute for the size and the color.
Actually #jzd your answer is pretty close but I would like to keep the attributes as key value pair.
The idea is to use and an attribute set and have a bar code associated with each set. here is a rough schema
AttributeSet Table:
AttributeSetId
ProductId
AttributeSetName
BarCode
AttributeUse Table:
AttributeSetId
AttributeId
AttributeSetInstance Table:
AttributeSetId
AttributeId
AttributeValueId
if you forget the barcode for a minute...
do you have a database to track this inventory?
are the items stored discretely in this database?
if so, then just add a unique number to the item, called the UPC vale - i recommend not trying to make an intelligent key s\as you are describing