In the first you are mixing row level calculations with calculations across multiple rows. This may help: http://www.theinformationlab.co.uk/2012/03/27/tableau-for-excel-users-part-2-calculated-fields/
Can you explain what you want the first calc to actually do, and where the numbers are coming from?
At the moment it looks like you check each row, then if it meets criteria, use a value that is from multiple rows.
1 of 1 people found this helpful
Sometimes this can be fixed by using attr - your calc would become
if attr([Period]) = [Parameter] ...
basically putting attr anywhere you have a row level calc.
Thanks for your reply.
when i have a variable V= sum(Y)/sum(Y)
or simply V1 = sum(X)
then i am trying to do like
If period=a parameter then V
else V1 end
or if simple contains(period,Q4)
I am getting issue
Any idea. Attr is not working.
Since an aggregation is being used on one field in the calculation, each field within the formula must also be aggregated. So it would look something like the following:
if (attr([Period])=attr([Period Parameter]) then
(if attr([Capability])='Hardware' and attr([Asset ID])=' ') then
....(the rest of the calc)
Hope this helps!
Thanks.I am sorry.I have earlier seen the same,but couldn't check as i have been to leave. Hence couldn't check. It is working fine. It seems you have changed the reference to 'Ranjan' from 'Ranjoo'. Infact 'Ranjoo' is called by my family. I didn't mind atall. Thank you very much.Can you suggest me how to handle the following issue.
if ([Region] not in ('APMEA','Canada','Europe','Latin America','US')
I am using 'or' for the same. But seems,something is going wrong. Can you please help me.
Simply query using or is not working:
if (attr([Region]) <>'APMEA' or attr([Region]) <> 'Canada' or attr([Region]) <> 'Europe' or attr([Region]) <> 'Latin America'or attr([Region]) <> 'US')
and (attr([Period_Trends]) <> '2006' or attr([Period_Trends]) <> '2007' or attr([Period_Trends]) <> '2008') then (sum([Total number of stores having HOT(Incl FOE)]) / sum([Total Stores SW]))
elseif (attr([Region]) <> 'APMEA' and attr([Period_Trends]) = '2007') then 2.5