9 Replies Latest reply on Oct 21, 2013 7:30 AM by Dan Huff

# What formula will get me the answer

I have my data in attached format with col1, 2 and 3. I have to derive Col 4 in tableau.

For each day, we have sales metric but when day 2=day2 i have to take the corresponding value from col2 and populate across all rows in col4 in tableau.

If function gives 100 only for second row but i need 100 to be populated for all rows

Attached the packaged workbook also. I want 318 to be populated in all the rows instead of one row.

• ###### 1. Re: What formula will get me the answer

I'm struggling with understanding this or at least why you would want to do it. Some more information or maybe png of the desired result/ workbook would be useful for one of us to help.

From what I think I understand you are most likely looking at a IF statement.

It's reallly hard to know without a packaged workbook or more detail. Sorry.

• ###### 2. Re: What formula will get me the answer

Please pop that data into a sample packaged workbook, and someone will help you get the result you're after.

Kyle, the formula you've written has the same criteria for the IF and ELSEIF; is this what you intended to write?

• ###### 3. Re: What formula will get me the answer

attached the workbook

• ###### 4. Re: What formula will get me the answer

No, I was thinking back about something I'd done before but forgot it required a parameter to replace [Col4] but at the end of the day it isn't relevant anyway. I'll remove the pseudo code, thanks.

• ###### 5. Re: What formula will get me the answer

What is the logic behind this calculation?  I do not understand at all.  I understand that if the begin date is the same as the order date, you want that value to appear in all rows--but why?  Why would it appear in any row except the one in which the dates match?

I've rewritten your calc to return the value as a string in the row where the match exists, and return an empty string (blank cell) when there is no match.  If the value really must appear in all rows, there may be a way, but based on the logic provided, I'm not sure how that would be possible.

• ###### 6. Re: What formula will get me the answer

that is the business logic.. its a kind of inventory amount that u have at the begin date, so for each day sales has to be compared with that amount.. The attached is just an example..

• ###### 7. Re: What formula will get me the answer

Sorry, but I would need a more concrete example of how this would be used/useful to the business.  It makes no sense at all to me at this point.  Perhaps someone else can help you out.  Best of luck.

• ###### 8. Re: What formula will get me the answer

I basically wanted the first row data in all rows to perform another calculation. And I got that via Lookup formula. Thanks

• ###### 9. Re: What formula will get me the answer

You can use the following formula: window_max(if min([Order date])=min([Begin date]) then sum([Value]) end)

This, however, will break if you have multiple data points within a month and are not showing the date as a day in the view.

Dan