How do I save forecasted values to use in calculations in Tableau? - tableau-api

I have a report that uses a couple years of historical data and uses the Tableau forecasting to show expected values for the next three months. I would like to be able to save these values for a few reasons.
I need to do calculations on the forecasted values. Multiple different people will be using this forecast and will need different calculations. Some will need to calculate 70% of the forecasted value, and some will need to calculate different percentages. I'd like to have a parameter for them to enter the percent and be able to create a calculation using the parameter and the forecasted value.
I would like to be able to save forecasted values to later show the difference between what was forecasted and what actually happened. I understand you can export your data from your forecast and import that as another data source to show actuals vs forecast, but I need to do it all automatically with no manual intervention.
Is this possible? I haven't found any way to save the values or do calculations on the values that are forecasted. I am using Tableau 10.5

Tableau will never save data. Probably easiest to create the forecast values in the datasource and then report. It's very simple to have "actual" values and "forecast" values so you can compare

Related

Tableau aggregate functions returning wrong values

I'm trying to calculate the sum of Impressions and Clicks by AdGroupId in Tableau. Tableau is returning wrong values of summation for several AdGroupIds although the underlying data seems to be perfectly fine.
Refer attached images - the sum of impressions and clicks for the given AdGroupId is clearly wrong.
Can anyone point out the issue or suggest what can be done in this case?
Before building a view, convert AdGroupId to dimension. From your screenshot it is clear that the field is a measure.
Ids are sometimes stored as numbers. Tableau automatically convert numbers to measure. But i don't think there will ever be need to calculate sum(id) or average of id.
Count you can calculate from dimensions too. It is therefore advisable to convert these type of dimension fields to dimension/string data type at the time of importing the data in Tableau. Hope this clarifies

Blended Data sources

I am new to tableau and was using blended datasources for showing values in the sheet. However I ran into a problem. While I am trying to get the date fields from one datasource which is blended into the ward code of another data source. I am trying to show the occupancy values in different dates. However, all I am getting is the sum of the values in the below field like so?
How can I change this to show different bed occupancy in different dates?
Instead of one number it should be filled with various smaller numbers from different fields
Can anyone give me an idea as to why this is happening. On doing joins I do the same thing and we get the values. However the numbers get fudged

Custom x-axis values in Power BI

I want to plot a graph over a year+weeknumber on the x axis.
Each data-point contains this specific value; for example week 7 of 2016 is expressed as 201607 etc. and called YearWeek
I created a date table in which I calculate all possible YearWeek value in a certain date-range. Then I created a YearWeek table extracting all distinct YearWeeks.
This I connected to the Fact-Table. What I want to chart is exactly according to this matrix:
Note that I explicitly selected to show items with no data to obtain the full time line. It continues down to 201852 but you get the picture.
When I attempt to plot this, it results in this:
It's hopefully clear that the straight lines running from 201652 to 201700 and 201752 to 201800 are the problem.
There's three things to note:
I explicitly need to keep the x-axis continuous, no gaps in the plots or x-axis values skipping several weeks for lack of data.
PowerBI somehow does not want to accept that these values count to 52 and then continue in the next year and decides to make the values strictly numerical despite these values not existing in the YearWeek dimension table.
If I change the values to text, PowerBI recognises that these are distinct categories, but it won't provide a continuous axis, just the values for which there is data.
I've tried to connect the YearWeek Dim table to an actual Date Dim table hoping that time intelligence would kick in; the problem is that both for the Fact Table and the Date Dimension table the YearWeek Dim is the unique value which won't work given the filter-direction. If I start messing with many to many relationships or bi-directional filtering I'm out of my depth.
How to fix this?

Generating values in cells based on other cells in Tableau

I work with passenger counting in a rail-company, and I have a question.
We only have automatic passenger counting system in on train, and that train doesnt go every hour of the day.
Here you see a table of when I have data, and when I dont have data:
I want to generate/calculate numbers in the white fields, based on the other fields, so we can have more correct total numbers of passengers.
Is this possible?
You can try to Pad data using IFNULL inbuilt Function.
IFNULL(SUM([NUMBER_OF_PASSENGER]),WINDOW_AVG(SUM([NUMBER_OF_PASSENGER])))
Instead of WINDOW_AVG you might select any other Analytics you want like WINDOW_SUM , WINDOW_MAX etc, whatever fits best .
Remember this is table calculation so your original measure must be there in the Sheet, you can hide it later in the viz .
Let me know if this works for you.

Different Aggregation calculations of a measure using two dimensions in Tableau

It is a Tableau 8.3 Desktop Edition question.
I am trying to aggregate data using two different dimensions. So, I want to aggregate twice: first I want to sum over all the rows and then multiply the results in a cummulative manner (so I can build a graph). How do I do that? Ok, too vague, here follow some more details:
I have a set of historical data. The columns are the date, the rows are the categories.
Easy part: I would like to sum all the rows.
Hard part: Given this those summations I want to build a graph that for each date it shows the product of all the summations from the earlier date till this date.
In another words:
Take the sum of all rows, call it x_i, where i is the date.
For each date i find y_i such that y_i = x_0 * x_1 * ... * x_i (if there is missing data, consider it to be one)
Then show a line graph for the y values versus the date.
I have searched for a solution for this and tried to figure it out by myself, but failed.
Thank you very much for your time and help :)
You need n calculated fields (number of columns you have), and manually do the calculation you need:
y_i = sum(field0)*sum(field1)
Basically because you cannot iterate on columns. For tableau, each column represent a different dimension or measure. So it won't consider that there is a logic order among them, meaning, it won't assume that column A comes before column B. It will assume A and B are different things.
Tableau works better with tables organized as databases. So if you have year columns, you should reorganize your data, eliminate all those columns and create a single field called 'Date', which will identify the value of your measure for that date. Yes, you will have less columns but far more rows. But Tableau works better this way (for very good reasons).
Tableau 9.0 allows you to do that directly. I only watched a demo (it was launched yesterday), but I understand that now there is an option to selected those columns (in the Data Connection tab) and convert them to a database format.
With that done, you can use a PREVIOUS_VALUE function to help you. I'm not with Tableau right now. As soon as I get to it I'll update this with the final answer . Unless you take the lead and discover yourself before that ;)