Tableau count number of times value repeated for the column, group by another two columns - group-by

How to count number of times "N" repeated for a particular value based on group by provider number and value in tableau? How to visualize this distribution in bar chart?
Thanks.

Make a calculated field:
SUM(IF [value 1] = "N" THEN 1 END)
Drag Provider Number to rows and the calculated field to text .
Repeat the above calculated field for more values.

Related

Tableau How to evenly split a Ranking Table into two

I am trying to evenly split a ranking table into two.
I tried to create a calculated field using rank to divide the data into two groups.
The problem with this approach is that there are too many entries in the first column because they are tie with rank 1.
I don't want to break the tie but display evenly in both columns.
So, desired output will look like...
25 states with Rank 1 are displayed in column 1, and the rest 12 rank 1 states and the other states from rank 38 to 49 are displayed in column 2.
In order to split your rows within a specif number (say 25) you can't rely just on rank due to same values for multiple rows.
Even though your Rank calculated field must be shown in the chart, you can add another calculated field based on rank_unique which will provide you a progressive number for rows having the same value for the specified metric.
Just use the specified function:
RANK_UNIQUE(SUM([Value]),'desc')
And then use the calculated field as a filter to "split" the results as you need (in this example 1-4, 5-8).

Tableau: Calculate the average value for the last 3 records

I have a time series data fro the different products. i like to calculate the average for each products based on only last 3 values. can you please help me.
Thanks
Kathir
Use SIZE() - INDEX() + 1
Drag it to your row or column and convert as discrete. Use table calc if needed
Now you will have an index for each row. Create another calculated field which will be using fix LOD of the above calculated field and when Index = 1 or 2 or 3, it sums it
You will be able to calculate average by diving the field with the sum of fix LOD created

compute difference between 2 ranked columns in tableau

I am trying to find the difference between 2 columns in tableau. The catch though here is that each column is ranked based on a value. The difference i need is between these 2 ranked columns
The rank is computed using the table calculations rank function. Attaching the picture for more information
I am assuming "current" and "prior" are calculated fields.
Just create a new calculated field, here I'll call it "Result". In this field just minus your one from the other so:
[Current - Prior]
Then pull this new field into your measures values on your sheet.

Get specialized row counts

I am generating reports using crystal reports.
My report filters data based on two possible values, Arcade or Franchise. The records can include both values. I want to get two totals for these values such that records with both values count towards both.
I filter data as Arcade = 1 , Franchise = 2 and Both = 0.
How can i get two totals for these values?
The easiest way to do this is to create two Running Totals in your footer.
For the Arcade total, count any record that has a filter value of 1 or 0.
For Franchise, count any record with 2 or 0.

Can't Sum Formula in Crystal Reports

I am trying to sum two different formula fields in Crystal. It will not let me select them from the Sum. The first formula is
if Sum ({tblPostedLine.pli_QUANTITY_SHIPPED}) >= 1
then {tblPostedLine.pli_NET_PRICE}
else ({tblPostedLine.pli_NET_PRICE} * -1)
I am trying to take a price and make it a negative value if the quantity is a negative value. I then want to sum the amounts to get a net amount that was shipped.
The other formula is
If PreviousIsNull({RodsvwCatalogAnalysis.pro_PROMOTION_CODE})
or ({RodsvwCatalogAnalysis.pro_PROMOTION_CODE}) <>
Previous({RodsvwCatalogAnalysis.pro_PROMOTION_CODE})
then {RodsvwCatalogAnalysis.pit_AREA_PER_PAGE} else 0
With this formula, I am trying to sum at a group level, not the details level. When I just sum the group level number, it is adding it every time the value is listed in the details as well.
I am open to any suggestions.
Thanks!
For the first scenario,
Create 1 variable formula in detail level to hold with your requirement.
for e.g.
#NetPrice , formula if {tblPostedLine.pli_QUANTITY_SHIPPED} >= 1 then
{tblPostedLine.pli_NET_PRICE} else ({tblPostedLine.pli_NET_PRICE} * -1)
using running total field feature in your Field Explorer to sum up the value and place
your group footer.
For the second scenario, I believe it relate to promotion group and again you could use the running total field feature to evaluate the sum condition and reset the value when condition are meet like field value change.