How to avoid aggregation of measure values in tableau - tableau-api

I'm trying to retrieve and analyze records from SQL server. Whenever I drag the measure values to rows field it gets auto aggregating itself in tableau.
I dont want this aggregation to be done since my values doesn't make sense when it gets agregated.
Is there a solution to remove this aggregation in tableau ?
Thanks

Yes, you can avoid aggregating values. However, your problem isn't that you are aggregating your values, your problem is that you are treating dimensions as measures.
To fix this you can convert Year from a measure to a dimension:
Of course, if you want to disaggregate the measures then you can always do that too:

Related

How to compare two averages for the same column?

I want to take an average of the whole data and then filter that data and take another average and then compare the two. Any help is appreciated.
Translating on sample superstore-
The following expression will give average of sales for entire data
{ Avg([sales])}
across all rows. The following expression will, however, give category wise average sales
{FIXED [Category]: avg([sales])}
across all rows again. If you want to apply filters on these calculations add that filter to context but be cautious that the filters will then filter the data used for calculations in both the expressions. If you just want to filter data for viewing purpose and not the calculations dont add the filters to context.

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

how to compare each record with the median of the whole set of data in tableau

I have a calculated field for the median, but I want to filter on each record, compare it with the median. The issue is when filtered, the median becomes the record itself. how can I fixed the median?
Thanks.
If you are using the latest Tableau, then you can use LOD calculation as advised by Alex. In your case, simply wrapping it in {} should do the trick: {MEDIAN([Sales])}
This will configure the calculation to ignore the effects of the filter. But if your worksheet is complicated, then more modifications to the formula might be required.
If you are using older versions of Tableau, then there is a more complicated workaround with table calculations and special filters to achieve the same result.

Multiply all rows in a Tableau table chart

This seems pretty simple, but I can't seem to find a way to do this.
I need to multiply all rows in a chart - or all columns, whichever is easiest. AKA. I am looking for something like the product() function in Excel.
Any ideas on how to accomplish this?
EDIT: Row values may change, so this needs to be a dynamic calculation. Like a function to aggregate all values into a product of the values.
A calculated field can be created with: sum([Sales])*PREVIOUS_VALUE(1)
This gives the running product. Then, that field can be inserted into the table.
You can certainly create a calculated field that will multiply various columns together. Something along the lines of [Column1] * [Column2] * [Column3] will generate a new calculated measure that is the product of all three columns.
That being said, if you're doing that much data manipulation within Tableau, you should probably be giving some hard thought as to why that's necessary. While calculations are certainly possible and new Tableau 9 features such as level of detail functions make doing calcs on measures not present in your viz easier, Tableau is primarily a data presentation layer. Data manipulation apart from simple calcs and pivot/unpivot operations should be done upstream. Doing advanced manipulations within Tableau, while sometimes/often possible, can be very hard to debug and reproduce.

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 ;)