Columnar report in Tableau - reporting

I'm new to Tableau. I'm using Tableau Desktop Professional 10.0.15. I need to write a very simple report that does not use any visualization.
Here's a example of the layout (the numbers are made up):
Web Site 1 North America Europe
Total Hits 3,523,483 3,523,483
Sessions 1,248,234 1,248,234
Unique Visitors 1,809,392 1,809,392
New Visitors 383,932 383,932
% new 10.9% 10.9%
Avg Page Views per user 1.9 1.9
Web Site 2 North America Europe
Total Hits 3,523,483 3,523,483
Sessions 1,248,234 1,248,234
Unique Visitors 1,809,392 1,809,392
New Visitors 383,932 383,932
% new 10.9% 10.9%
Avg Page Views per user 1.9 1.9
The users want the measures to be in one column, but they're not the same measures. Some measures need to be formatted as percentages. The average should have 1 decimal place. I have a feeling it's not possible to format the same measure differently in Tableau. Ideally, there would be something like a banded report where I could stack the measures on top of each other. But, I don't see a way to do that in Tableau. I could create a table in my database and put the measures in the same field and add the formatting in the database (which feels wrong), but it would have to be text (to have '%'). But, Tableau won't treat a text field as a measure. Also, it seems like if you don't add a measure, Tableau will insert a fake measure and put 'Abc' as the value (at least, I think that's why I'm getting these 'Abc' columns in my reports that I didn't add and that aren't in my data).
It seems like Tableau wants you to do something like this:
Unfortunately, this is not what my users want. Any suggestions?

In Tableau it's possible to put many measures in a single column using the measure names in rows.
To do this, add to filters shelf the dimension called Measures Names (the last one). Select all the Measures you'd like to show (Hits, Sessions, Visitors, Views, etc.). Then, drag this dimension to the rows shelft. Next, drag the measure called Measures Values (the last one too) to the marks shelf, specifically in the text box. You can also add other dimension to rows shelft (like website) to the left of Measures Names. This will show a table similar to your requirement.
By default, the Measure Values are SUM of each measure. Just right click on them and select the aggregation you need (AVG, COUNT or other).
Finally, you can format each measure as you want, right click a measure value, and select Format...

Related

Netsuite Formula Calcs

So I was able to create a search that shows historical unit rates at an item level then I can filter by customer to show any price increases that may have taken place to create a price tracker. It works as advertised. Below is a screen shot of what the output is. "Base Price" is the minimum item rate for lifespan since we transitioned to NetSuite. Then 1-6 months back it will pull the item rate and as you can see, around the 3rd month, it increases and shows change.
Here is how the search looks when executed
What I am attempting to do now subtract the values from the formula from the "base price" because that is at the end of the day the total impact value. Eventually I want to bring in quantity so we can see the total impact of these changes to track if we are seeing an increase or not.
EX. If base is $2 and we sell 20 a month. $40 in sales. Now we up it to $3, sales would be $60. But we want to show the $20 in increase impact instead.
Below is from the results tab to generate the above.
Here is the view from the Results Tab
Is there a way to create that calculation somehow in NS? I am almost thinking it is because I used the DECODE instead of the CASE WHEN ?
Thank you
You can generally combine supported functions; you just need to make sure that any functions applied in the Summary or Function columns are replicated in the formula. For example, your first column "Item Rate" has a Summary function or "Minimum" applied - this needs to be included in the formula, something like:
DECODE(...) - MIN({rate})

Swapping rows and columns in a matrix in Power BI

I want to analyse the sales of a certain company in Power Bi. I have a customer dataset with nine columns (gender, city, age range, hair colour etc.) and one million records. Now I want to put those columns in a matrix. For instance:
Rows: Gender
Columns: Age Range (<16, 17-20, 21-25 etc.)
Values: Number of Sales
I present this dashboard towards some people and I want to 'play' with the data. What happens if I change the rows to 'hair colour' for instance. Is there a way to do this without using bookmarks? In one sentence: swapping rows and columns of a matrix while you present the dashboard and cannot use the option 'Fields'? Or at least point me in the right direction? It would really help me. Thanks in advance!
Unfortunately, the quickest way to do this is using the Fields pane. The only other option that is available would be Bookmarks, but I guess you have already tried that. I guess you are an option similar to the one available in "Pivot Charts" where you can "Switch Rows/Columns" with the click of a button. That option is not available in Power BI at this point, as far as I know.

OBIEE 11g Sort Pivot Prompt

I have created a query that selects user base data from two different weeks, uses a MSUM to work out the difference between the two weeks and then create a projection of base size across different verticals based on the net change.
This requires the use of a pivot table with prompts to display just the data from the most recent financial week (in format YYYY-MM), however, every time a new week rolls around, it resets the ordering in the pivot prompt to show the least recent week, which makes the calculations redundant.
I can't re-order the weeks in the base data, as the MSUM calc requires a specific order to be used across multiple dimensions.
Whilst this is very easily fixed by the end user each time by changing the drop down, or by the support team by editing the pivot table and changing the prompt before saving, (which then persists until the next week), it is either going to be a poor customer experience, or extra work for the support group.
Is there a method that I'm missing to create a sort on the pivot prompt options from within the pivot table options?
The equation follows this kind of logic...
"Metrics"."Base Size" + (
(
(
"Metrics"."Base Size" - (
MSUM ("Metrics"."Base Size", 2) - "Metrics"."Base Size"
)
) / [days in time period]
) * 365
)
OBI will order the data as defined by the sort order in the RPD, but ascending is probably the best choice for it at that level.
In your case you could put the Analysis on a dashboard and use a dashboard prompt instead. For that you have the ability, in the options, to change the "Choice List Options" to SQL Results. This should put in a default query, to which you could add an ORDER BY clause. You can also set that to default to the most recent/current period no matter the sort order of the column.
SELECT "Date"."Financial Week"
FROM "My Subject Area"
ORDER BY "Date"."Financial Week" DESC
Instead of using the MSUM() function, you may also be better to use one of the built in time-series functions that can get the value of a previous period for you, without having to rely on any ordering. Have a look into the Ago() function to get the previous period.

How can I get the values in the Matrix on my SSRS report to repeat?

I know there must be a simple answer to this, but I can't find it.
I have added a couple of textboxes to a Matrix in a BIDS/SSRS report. I've given these textboxes values such as:
=Fields!WEEK1USAGE.Value
It works (after a fashion); when I run the report (either on the Preview tab, or on the Report Server site) I see the first corresponding data value on the report - but only one.
I would think that once a value has been assigned via expressions such as "=Fields!WEEK1USAGE.Value", each value would display (rows would automatically be added).
There must be some property on the Matrix or the textbox that specified this, but I can't see what it might be.
Here is how my report looks (very minimalistic, so far) in the Layout pane:
...and after running, on the Preview tab:
Obviously, I want the report to display as many rows as necessary, not just one. The textboxes do have a "RepeatWith" property, but there description doesn't sound interesting/useful/promising.
I don't see any property on the Matrix control that looks right, either.
I thought maybe the designer was only showing one row of values, and ran the report on the server, too, but there also it just shows the two values.
So what do I need to do to get all the data for a provided field?
Matrices are for display of grouped data and summary information, usually in a horizontally expanding pivot table type of format. Is a matrix really what you are after? Looking at your expression you have =Fields!Week1Usage.Value but in a matrix what I expect to see would be at least =Sum(Fields!Week1Usage.Value) or even better just =Sum(Fields!Usage.Value). Then you would have ProactDescription as your row group and the week as your column group and it would all just work out everything for you, grouping and summing by Proact vertically and expanding the weeks out horizontally.
What seems to be happening is that you have no grouping on rows or columns and no aggregation so it is falling back to the default display which is effectively the First function - it displays the first row of data and as far as the matrix is concerned it has done its job because there is no grouping.
Without knowing your problem or data, I'll make up a scenario that might be what you are doing and discuss how the matrix does the heavy lifting to solve that problem. Let's say you have usage data for multiple Proacts. Each time one is used you record the usage amount and the date and time it is used. It could be used multiple times per day but certainly multiple times in a week. So you might be able to get the times each Proact is used from a table like so:
SELECT ProactDescription, TimeUsed, Usage
FROM ProactUsage
ORDER BY ProactDescription, TimeUsed
In your report you want to show the total weekly usage for each Proact over multiple weeks. Something like this:
Proact Week1 Week2 Week3 ...
Description Usage Usage Usage ...
--------------------------------------------
Anise, Fennel 1 CT 20.00 22.50 16.35 ...
St John's Wort 15.20 33.90 28.25 ...
...
and so on. Using a dataset based on the SQL above we create a matrix and in the row group properties we group on =Fields!ProactDescription.Value and in the column group properties we group on a week expression like =DateDiff(DateInterval.Week, Fields!TimeUsed.Value, Today) and then in the intersection of the row and column we put =Sum(Fields!Usage.Value). To display the header of the column nicely put an expression like
="Week " & DateDiff(DateInterval.Week, Fields!TimeUsed.Value, Today)
The matrix automatically does all the summing by week and product and expands the weeks horizontally for as many as you are reporting. For bonus points you can also put totaling at the end of the columns and the rows to show the total use of that Proact for the period (row total) and total use of all Proacts in that week (column total).

Linq to SQL - Random Select Order and Paging

We have a database with 2,00,000 vendor in 100 plus category, if someone visit the website we want to allow them to select a category and show them 25 Vendor per page, first we kept order by VendorId but it always use to get first 25, but we removed it, but now in paging it sometime repeat the vendor, is there a way to get random 25 vendor and also keep the paging.
Regards
you can randomize your result but everytime you dot he query, it will create new random list so unless you randomize and save the randomized state in your Code and page over it, it cant be done straightforward way.
refer, SQL Query results pagination with random Order by in SQL Server 2008
I believe this requirement is impossible to implement if a new random order is needed every time, there needs to be good performance and every item should have equal chance to get selected. I believe you should redesign the way your application works.
One possible workaround is to have a couple of columns in a table and fill them with random numbers. When a user requests the list assign the random column to him (stick it in the URL for example). Then do an order by that column and display the results. Randomly switch 4-5 columns to create the appearance of randomness. Update the random numbers in the columns once a day.

Resources