
1. Re: Replication of SumIf Function
Joshua Milligan Apr 6, 2013 9:56 PM (in response to Tony Gruebner)Tony,
The calculation would probably look something like this:
SUM(
IF Month = 1 THEN Value END
)
Tableau calculations are very flexible. You can embed some sophisticated logic, other calculations, and parameters. You can do calculations at a row level, an aggregate level, or even a result table level. It is definitely a different paradigm than Excel, but I think once you get into it you'll really love it!
If the above calculation isn't quite what you are looking for, please let me know and possibly provide some additional data. Thanks!
Regards,
Joshua

2. Re: Replication of SumIf Function
Tony Gruebner Apr 7, 2013 2:08 AM (in response to Joshua Milligan)Hi Joshua,
Thanks for the answer.
I can't quite get this formula to work. What I am trying to do is get the previous month so I should have stated that the SumIf function in excel would be:
SumIf(MonthColumn,[Month]  1,Value).
I tried to put the following formula into Tableau:
Sum(If [Month] = [Month]  1 then [Value] else 0 end)
However, this obviously doesn't work as the month can't be month minus 1
Any suggestions.
Thanks
Tony

3. Re: Replication of SumIf Function
Joshua Milligan Apr 7, 2013 9:15 PM (in response to Tony Gruebner) 
4. Re: Replication of SumIf Function
Tony Gruebner Apr 7, 2013 10:54 PM (in response to Joshua Milligan)Hi Joshua,
This worked perfectly, but I have no idea how.
How did the calculated field know to LookUp the month field where there is no mention of the month field in the calculation?

5. Re: Replication of SumIf Function
Joshua Milligan Apr 8, 2013 10:10 AM (in response to Tony Gruebner)Tony,
LOOKUP is a table calculation function. If you right click the field on the Measure Values shelf you can select the "Edit Table Calculation" option to see all the different options for table calculations. In this example, I left the default of "Compute Using: Table Down" which means that Lookup(SUM(value), 1) will lookup the previous value (the 1 offset) going down the table. In this case, that means it gets the previous month. You could much more explicitly define the table calculation to work that way (by default or in this particular view).
This thread has some good information on table calcs: http://community.tableau.com/message/202808#202808
Regards,
Joshua