Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to get the code below to work. It works fine when using the line that is commented out -
if( (Business_GF_Old<>Business_GF) and (Report_Grouping_Old<>Report_Grouping),Constant,0)
However, I need these values to change dynamically with the values for vBus_Dim_Name_Old and vBus_Dim_Name. I've tried single quotes, double quotes, but can't get it to work. Any help is greatly appreciated. Thanks.
Sum (
{<
Hires={0},Terms={0}
>}if( ($(vBus_Dim_Name_Old) = $(vBus_Dim_Name)) and (Report_Grouping_Old<>Report_Grouping),Constant,0)
//>}if( (Business_GF_Old<>Business_GF) and (Report_Grouping_Old<>Report_Grouping),Constant,0)
)
Hi Arthil
I suggest you to check the Variables. Check whether the variables are returing you the correct value.
If so, then i may ask for sample file.
Regards,
Srini.
Hi
I don't know what you tried but single quotes should work, like this
Sum ({<Hires={0}, Terms={0}>}
if( '$(vBus_Dim_Name_Old)' = '$(vBus_Dim_Name)' and Report_Grouping_Old <> Report_Grouping,
Constant, 0))
Hope that helps
Jonathan
Jonathan - I tried single quotes, exactly like you have, but it didn't work. Any other ideas? Thanks.
Srini - what is the best way to check the values of my variables. Under Settings >> Variable Overview, I see the values for my variables.
Then I suggest that you post your application (or some subset of it), so we can examine why. That statement is syntactically correct, so I suspect the problem may be somehow in the data (one or more embedded quotes, for example).
Jonathan
Hi Arthil,
I tried with sample data and this function worked well.
Sum(IF($(vDim_Selected) <> $(vOldDim_Selected),sales))
vDim_Selected - Definition is "=GetFieldSelections(Fields)"
vOldDim_Selected - definition is "=GetFieldSelections(Old_Fields)"
Regards,
Srini.
Srini - my variables are being populated via input boxes. Do you think that would make a difference?
Hi arthil21,
variables can be populated by any means.. input boxes, fields, etc
the code by srinivasa works fine.
i believe the issue lies in the data.. maybe not proper cleansing or different format(uppercase/lowercase/mixedcase/spaces) might lead to the condition getting unfullfiled..
i advise you to check the data for correction first.
Cheers,
Abhinava
All: thanks everyone for your help. The code actually works as I originally wrote it. The problem was that my evaluation for this piece should have been "not equal to" (<>):
$(vBus_Dim_Name_Old) = $(vBus_Dim_Name)) should be $(vBus_Dim_Name_Old) <> $(vBus_Dim_Name))
I also found that with or without single quotes didn't seem to make a difference. Does anyone know which one is syntactically correct?
$(vBus_Dim_Name_Old) = $(vBus_Dim_Name))
or
'$(vBus_Dim_Name_Old)' = '$(vBus_Dim_Name)')