How to hide expression label in Grafana? - grafana

My Grafana panel consists of 4 queries: A,B,C and D.
All of them but D are hidden. They all have same label names so I suppose that grafana adds D prefix to avoid name collisions.
The thing is that I won't have name collisions because only last query is visible. Can I somehow hide this D prefix?
These are my last query settings:

Related

Display values in the dashboard title based on filter selection in Tableau

I have a list of product names with some values tied to them. These product names are also applied as filter. Let's say these products are named as Prod A, Prod B, Prod C, Prod D, and Prod E. My goal is to display the product names which are selected in the filter as dashboard title, but the twist is that Prod C and Prod D together describe a new product called 'Personalized Product', which means if Prod C and Prod D are selected from the filter, the dashboard title should display Personalized Product whereas if only Prod C is selected in the filter, the title should be displayed as Prod C. Similarly, the other product names should be displayed in the title when selected individually from the filter. Is it possible to achieve this without using a parameter?
I have attached a sample workbook for reference in the link below with what I have done so far. https://drive.google.com/file/d/1w9aZTqw3ndo87HxUVwcP1lbj4yHW3hSZ/view?usp=sharing
Thanks!
One way to do this would be with an LOD calc and a context filter. You can create an LOD calculation a the Product Group level that determines how many products within that group are being shown. If it is more than 1, then show the group name, otherwise, show the product name. Next, use this instead of Product Name on your worksheets and add the Product Name filter to context. This way the calculation will only look at data that is currently on the worksheet when computing. Here is a calculation that would work:
{FIXED [Product Name (group)]:
IF COUNTD([Product Name]) > 1 THEN MIN([Product Name (group)])
ELSE MIN([Product Name])
END
}
Then if you want to showcase the selected products you can use a worksheet that lists out the products in place of the actual dashboard title. You can do this simply by just putting the calculation on text on a blank worksheet. Or, you can go a little nicer with a calculation to display them with punctuation like this:
PREVIOUS_VALUE("") +
IF FIRST() = 0 THEN ""
ELSEIF LAST() = 0 THEN " & "
ELSE ", " END
+ MIN([Group Calc])
And then add a filter for LAST() = 0 to keep just the last row:
Here's what the setup looks like:
Add the LAST() = 0 filter and hide lines and headers:
All together:

How to group rows in Tableau into bands?

I'm fairly new to tableau and I'm having the following issue. Below is a sample of the data I'm using.
Count | Item
___________________
1 A
3 B
2 C
3 D
5 E
2 F
5 G
9 H
I'm trying to group some of these together so I can show a stacked bar chart of these groups like the following:
Count | Item
___________________
6 A-C
10 D-F
14 G-H
How to do this?
Use Tableau's built-in Create Group feature
View and download the solution workbook on Tableau Public:
https://public.tableau.com/profile/fosstin#!/vizhome/HowtoGroupYourDatainTableau/Dashboard-HowtoGroupYourData
Right-click the Item dimension and choose Create > Group. This will open the Create Group dialog window.
At the top of the window, in the Field Name text field, enter a name for your grouped dimension or use the default title provided by Tableau, which is Item (group)
Select the first set of letters you wish to group, then click the Group button. Multiselect rows by holding down the control key or the shift key.
Type in a name for the group(i.e. A-C) and press enter.
Repeat steps 5 and 6 to create the D-F and G-H groups, then click OK.
Drag the Item (group) dimension to the Rows shelf and the Count measure to Text in the Marks card.
Add a column header to the Count column by double-clicking Measure Values in the data pane.
Right-click the Measure Values pill now on the Marks card and choose Format. Then, in the formatting pane, choose Numbers > Number (Standard)
References:
Tableau Help: Group Your Data
https://help.tableau.com/current/pro/desktop/en-us/sortgroup_groups_creating.htm#create-a-group-from-a-field-in-the-data-pane
Tableau.com Blog: The one-click trick for create headers for single-measure tables
https://www.tableau.com/about/blog/2015/11/how-create-fast-headers-single-measure-tables-45945
You can use a CASE statement to create the groups. I named it group in my example.
CASE [Item]
WHEN 'A' THEN 'A-C'
WHEN 'B' THEN 'A-C'
WHEN 'C' THEN 'A-C'
WHEN 'D' THEN 'D-F'
WHEN 'E' THEN 'D-F'
WHEN 'F' THEN 'D-F'
WHEN 'G' THEN 'G-H'
WHEN 'H' THEN 'G-H'
END
Then add group to your Rows shelf and Count to your text.

How to change ordering on multiple columns in Crystal Reports

I am trying to display a list of names in crystal reports in multiple columns only if there are enough names that it would split into multiple pages otherwise. I want the ordering to be "across then down" when it's in two columns, otherwise if there aren't enough names, just display a single column of names in order.
The problem I'm having is that the ordering is off when it's in two columns, it goes like:
A - F
B - G
C
D
E
But I want it to be like:
A - B
C - D
E
F
G
And for only a small group that fits on one page, like this:
A
B
C
I have "Format with Multiple Columns" in the "Common" tab, and "Down and then Across" on the Layout tab.
Crystal doesn't have dynamic expression option for 'Printing direction' so you must commit to either 'Across then Down' or 'Down than Across'.
As a way around that, you can insert to subreports, each with a different choice for that property. Then, suppress one and show the other based on the number of records.

Count of group dimensions item in Tableau

I'm fairly new to tableau and I'm having the following issue. Below is a sample of the data I'm using.
Customer No | Item
___________________
1 A
1 B
2 A
3 A
4 A
4 B
5 B
6 A
I'm trying to get a count of how many customers bought Item A and B. So far I tried doing a separate group by combining A and B but I get the total result of 8. I also tried doing a calculation and I'm getting the same result of 8. Can someone please point me to the right direction on how to get this result. Thanks!
This is the result I'm trying to get:
Item| Count
A 5
B 3
A and B 2
I recreated your exact dataset and pasted it into Tableau so you could see a couple of examples.
Here's how you can see the number of customers who purchased an individual item, plus the number of customers who purchased both items.
Your calculation will be:
IF { FIXED [Customer No]: COUNTD([Item]) } = 1 THEN
[Item]
ELSE
'Both A and B'
END
And you'll need to set your view up to look like this:
Below are ways you can see when both items were purchased.
Boolean OR
The calculation you'll want to use is:
ATTR([ITEM]) = 'A' OR ATTR([ITEM]) = 'B'
And you'll want to set up your view to look like this:
A, B or Both
If you would like a bit more specificity in your result, you might try:
IF ATTR([Item]) = 'A' THEN
'A'
ELSEIF ATTR([Item]) = 'B' THEN
'B'
ELSE
'BOTH'
END
Replacing the previous calculation with the new looks like this:
More than 1 item
If the specific items purchased don't matter, you could use this logic.
COUNTD([Item]) > 1
Replacing the previous calculation with this one would look like:
More than 1 Item using a window function (probably overkill)
The calculation you'll need to use is:
WINDOW_COUNT(COUNTD([Item]))
Because this is a Window function, we'll need to specify how it's calculated across our dimensions. To do this click the down arrow on the right-hand side of the pill and select Edit Table Calculation...
You'll then need to set these settings:
I'll add the calculation we created in the first example ([A and B]) to the filter shelf and select True. That should give you something that looks like:
More than 1 item using a Level of Detail expression
The calculation for this example is:
{ EXCLUDE [Item]: COUNTD([Item]) }
You'll view should look like:
As you can see Tableau is quite flexible. Hope these examples were helpful!
You might want to use Tableau’s set feature to approach problems like this.
For example, right click on the field [Customer No] in the data pane (i.e. left sidebar) and choose the “Create Set” command. Click “Use All” at the top of the set panel and then click the Condition tab. Define the set using the condition MAX([Item] = “A”). Name the set “Customers who bought A”.
Similarly, create a set of customers who bought item B. You can then select both sets in the data pane, and create a combined set to be the intersection, that is, customers who bought both an item A and an item B.
You can think of a set as either a mathematical set of the members of a field that belong to the set (i.e. a set of customer ids) or as Boolean function defined for each data record in the data source indicating whether that data record is associated with the set (i.e. a Boolean function that operates on transactions to say whether the associated customer ID is in the set. A key to keep in mind for the condition formulas used here is that the condition is an aggregate formula, operating on a block of data records for a customer ID to determine whether the customer ID is in the set.
Once you have defined your sets of interest, you can use them in many ways - in calculated fields, as filters, as dimensions on shelves in a visualization, in set actions, to combine with other sets ...
To define a measure that counts the customers in a set, create a calculated field such as “[Num A Customers]” as COUNTD(if [Customers who bought A] then [Customer ID] end) Do the same for whatever other sets you are interested in. Then you can use those measures (probably with Measure Names and Measure Values) to make your viz.

CR2008: display cross-tab with no spanning

I'm writing a report that can be exported to excel and using cross tabs. I have two groups A and B, where A can contain multiple subgroups of B.
When I drag A and B into the rows on the left, the outermost group A spans multiple rows depending on how many subgroups of B there are.
Is there a way to have group A repeat itself for every row of B? Like a full table without any of that cell-spanning.
I'm not sure if this will work for you since it means you can't do Totals on the outer group, but here is one possible solution. Create one formula that concatenates both group A and group B values together and use that in your cross tab instead. In this example, I had to use a format string to get the numerical-to-string values to sort correctly.
EDIT: Never mind, I fixed it so you can have the outer group Totals, too. Just leave the outer grouping the way it was, but replace the inner grouping with your new concatenated string (via the formula you just made). You'll have to suppress the outer group header (shown in the screenshot) and format the grid lines to look nicer or overlay a whiteout box, though (not shown in screenshot).