How to return the value on which the condition is met for the first time?

0 votes

I only want to return the left most value i.e., the value when the condition is met for the first time.enter image description here

In the images it shows 95% 96% etc etc I only care for the column 5 where the condition of 95 is met. The percentages are calculated this way.

ROUND( RUNNING_SUM( SUM( [days_to_close_cnt] ) )/ SUM([newo_dt_cnt]),2 )

Using and the "Days to Close" gives me the column information.

The Line graph looks like this:

enter image description here

if [% Completed] >= .98  and  [% Completed] < 1 then INT( 98 )
elseif [% Completed] = 1  then INT(  1 )
elseif  [% Completed] >= .95  and [% Completed] < .98 then INT( 95 )
elseif  [% Completed] < .95 and [% Completed] >= .0 then INT(  0 )
end

I am using the above calculation to color in this case. enter image description here

Aug 10, 2018 in Tableau by AwesomeSauce
• 860 points
29 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

It looks like you are trying to tell when a running total crosses a threshold. In Tableau, doing that requires table calculations which operate on the aggregated values that have been returned from the data source.

I put together an example to illustrate how to approach this issue. Here's a static snapshot of my example:static snapshot

You can define a boolean calculated field to tell whether the running total meets the threshold on a particular day and then use window_min() to calculate the first day that meets the threshold.

Table calculations are powerful, but are also the feature in Tableau that takes the most time to get your head around. So break things down and tackle them in small bites instead of trying to write complex table calculations all at once. Be aware that specifying the partitioning and addressing fields (i.e., compute using) for a table calculation is as important as writing the formula.

Also you can rewrite your Calculated field as below:

if [% Completed] < .95 then 0
elseif [% Completed] < .98 then 95
elseif [% Completed] < 1 then 98
else 1
end

I hope this helps!
answered Aug 13, 2018 by Naruto
• 710 points

Related Questions In Tableau

0 votes
0 answers

How to export the IdP (Identity provider) XML Metadata from Keycloak which is imported to Tableau?

Keycloak version 1.6.1, Goal: Keycloak should act ...READ MORE

Mar 28, 2018 in Tableau by Atul
• 5,490 points
289 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
2,389 views
0 votes
1 answer

Is it possible to join tables on the basis of some calculated field in Tableau?

@Ammy999, You can not perform join in ...READ MORE

answered May 16, 2018 in Tableau by Mathew1810
65 views
0 votes
1 answer
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,220 points
1,096 views
0 votes
1 answer

How interactive graphs are generated in Tableau?

Lot of back end code is shared ...READ MORE

answered Apr 13, 2018 in Tableau by xyz
• 1,550 points
26 views
0 votes
1 answer

How to determine average per event by year?

Hi Roshan, Create a new calculated field (use ...READ MORE

answered Sep 25, 2018 in Tableau by Machdata
• 340 points
42 views
0 votes
1 answer

How to combine rows with same information in Tableau

@Ghost, Tableau has a function RANK_UNIQUE which you ...READ MORE

answered May 24, 2018 in Tableau by Atul
• 10,220 points
442 views
0 votes
1 answer

How to refresh the extracted data source automatically in Tableau Desktop?

Hi AwesomeSauce, This comes up every so often!  Tableau ...READ MORE

answered Aug 13, 2018 in Tableau by Naruto
• 710 points
634 views
+1 vote
2 answers

How to join tables based on “Calculated Fields” in Tableau?

You absolutely can join to a calculated ...READ MORE

answered May 29 in Tableau by anonymous
641 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.