How to Sum based using an if statement?

0 votes
How to sum up values according to IF condition? i want to calculate sum of sales if profit has reached is greater or reached a constant.
Apr 24 in Tableau by Priya
16 views

1 answer to this question.

0 votes
Hi Priya,

Follow below steps:

1.  Click on Analysis - > Calculated field.

2. For suppose if you want to find sales for profit >100 and then display their sum of sales then,

IF [Profit] >2000 THEN [Sales]

ELSE O

END

3. This would give sales for only those whose profit >2000.

4. So similarly, you can group fields using condition and then perform aggregation using IF condition.

Hope this helps you.
answered Apr 25 by Cherukuri
• 22,030 points

Related Questions In Tableau

0 votes
1 answer

How to use a IFF statement in Tableau

Use this syntax -  IIF(([Avg_sale] > [Today]),STR([Avg_sale ...READ MORE

answered Apr 5, 2018 in Tableau by QueenBee
• 1,810 points
124 views
0 votes
1 answer

How to use LOD to count distinct number of records based on some condition?

From the desired output it seems that ...READ MORE

answered Apr 9, 2018 in Tableau by xyz
• 1,550 points
3,781 views
+1 vote
1 answer

How to authenticate and embed Tableau Rest API using Python 2.7

Your .format() call is creating a bad ...READ MORE

answered Jul 18, 2018 in Tableau by Atul
• 10,240 points
412 views
+1 vote
1 answer

How to add filter on different sheets based on clicks?

Go to Actions… (if you're on a dashboard, you ...READ MORE

answered Aug 1, 2018 in Tableau by Atul
• 10,240 points
44 views
0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
1,618 views
+1 vote
1 answer
0 votes
1 answer

Calculated filed with if-then

Below is the required code:  IF (NOT ISNULL([test2])) ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
63 views
+2 votes
1 answer
0 votes
1 answer

How to perform a calculation using one variable with an aggregation in calculated field?

Hi, You can use the calculative field and ...READ MORE

answered May 20 in Tableau by anonymous
• 22,030 points
24 views
0 votes
1 answer

In Tableau, How to sum the last 7 days of the value?

It can be achieved easily by creating ...READ MORE

answered Mar 12 in Tableau by Cherukuri
• 22,030 points
343 views