How to create a column in Microstrategy that contains the sum of another column - microstrategy

I want to make a column that contains only the value $18,432,807 so I can find the percentage that that months profit is of the total profit.

If you right-click on a metric column, you should be able to choose new -> metric. You'll then be prompted to provide a formula, where you can use other metrics also in the dataset.

you can do as loco suggested, or you can create another metric at Year level and then a metric with does OriginalMetric/YearMetric

Related

calculate difference between two queries in grafana

I have a grafana dashboard with 2 influx queries which calculate a single value (A and B)
I now need to calculate the difference between those to A - B.
Is this somehow possible within influx or grafana?
Note, the two values come from the same database but from different measurements
To show the difference of your two queries you first need to select the "Transform" tab.
Then "Add field from calculation".
Select your field names A and B.
Choose "Difference" as calculation method.
Select "Replace all fields" if you only want to see the difference.

How do I find the average age of users based on value of another column?

I have a dataset for health procedures with each patient listed under Index_Num. Most patients are listed several times as they have had several services. There is a column with their age.
There is another column called Portal_Use, which says "Yes" or "No" based on whether the user is a portal user.
The question I am trying to visualize in Tableau is the Average Age of Portal Users.
I created a group of the Index_Num, but don't know where to go from there. I'm essentially looking for a bar chart that has one bar for portal users and one bar for non portal users with the average age. This would be very easy if there weren't multiple rows per patient.
Based on your explanation I have used below data to generate the sample workbook.
Use your Portal_Use flag as a Columns
Add Age as an AVG value in Row section
From Show me section select the Type of Bar char you needed
Above will give you desired results as per below.
I hope this helps!!!

Sales vs Profit Dashboards in Tableau

I'm trying to achieve a viz in Tableau in which If I click on a paramteer value called sales then sales viz should be selected and if I click on parameter value Profit, then profit viz should be displayed.
Can this be done using parameters in the first place?
Or Action filter is the only option?If action filter is the option can I make sure that If I select one parameter say Sales then the other Viz should be hidden automatically.
I found this link in the tableau training tutorial which might be useful for you.
https://www.tableau.com/learn/tutorials/on-demand/advanced-training-parameters
Steps to follow.
1- Create a parameter with data type "string" which will display either Profit or Sales as values.
2- Create a calculated field with case when function to link your parameter to the measures you want to use (in your case sales or profit).
CASE [Parameter - Sales or Profit]
WHEN 'Sales' THEN [Sales] ## assuming your sales dimension is sales.
WHEN 'Profit' THEN [Profit] ## assuming your profit dimension is profit.
ELSE 'Others'
END
This link would be helpful http://onlinehelp.tableau.com/current/pro/desktop/en-us/help.htm#changing-views-using-parameters.html
3- Build your graph
4- Show Parameter control (the one you created in the first step).
Every time you update the parameter, the graph will be updated.
Hope you find this useful.
A simple solution is to put measure values on either the row or column shelf; and measure names on the filter shelf. The show the filter control for measure names.
The downside is that people can choose other measures that you did not intend to expose
Yes, you can do it with parameters. You use a layout container to hold each sheet and then the parameter will filter one and not the other.
See this post for details. http://www.bfongdata.com/2014/10/chart-creation-with-parameters.html

How to create the grant total for AGG variable the table tableau dashboard

NUMBER OF OPPORTUNITY= count([opportunity id])
how to sum up the NO.of opportunity for each category
for example:
health grant total:8
commercial lines grant total: 9
Thanks a lot
To display subtotals, choose Show all subtotals from the Analysis menu under Totals.
To calculate subtotals, you could use either a fixed or exclude LOD calculation. LOD calcs are described in the help and worth the time to understand.
Also, be sure you understand the difference between Count and Count Distinct. All count([xxx]) does is return the number of data rows that have a non-null value for the [xxx] field. If [xxx] is never null, that is the same as SUM([Number of Records])
I am trying to explain with example as:
Your data is as per above example and you want totals of all region according to category wise.
Here are the steps to execute.
1.Go to analysis > totals > Total using subtotals and you will get results as
2.To get exact sum follow the steps as per below :
Hope this will help.

Tableau creating a calculated percentage (non-aggregate) based on an aggregated total

Either I am the first person to ever need to display percentages in Tableau or I do not know what to search for! I highly suspect it is the latter...
I believe what I am attempting to ask is how to make a calculated non-aggregated field by dividing by an aggregated number. Although I would prefer just to be able to display the percentages instead of a whole number.
This is how I would do it in Excel:
The data that already exists is Column A and B. In Tableau these would be non-aggregated. What I need to do in Tableau is to generate what is column C (also non-aggregated) because it does not exist in my data. In excel, all I did to get the aggregate number (total) of column B was:
sum(B1:B4)
And for the column C:
=B1/$B$5
But I can't seem to do this at all in Tableau. When I try to use the same syntax, I get an error message: "Cannot mix aggregate and non-aggregate arguments with this function."
Instead of having a calculated field, you can use a Quick Table Calculation on the column.
Right-click the pill of your data > Quick Table Calculation > Percent of Total. This will show the percentages instead. If you want to keep both, just duplicate column b first and then add the table calculation to the new column.