Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Please Help

Hi,

I'm struggling with an IF-condition that I can't get to work in my tabell. I created a variabel called vAcceptedCurrentYearDirectNoMissing that works fine when I use it in my expression: $(vAcceptedCurrentYearDirectNoMissing).

But when I put it in my if-condition (see underneath) and use it in my expression it doesn't seem to work.

if(GetCurrentField([C_CampSales]) = 'NameInsurance',

$(vAcceptedCurrentYearDirectNoMissing))

Can someone please help me with this?

Regards,

Johan

8 Replies
Not applicable
Author

try this

sum({$<[C_CampSales] = {'NameInsurance'}>}$(vAcceptedCurrentYearDirectNoMissing))

then select the data(that is NameInsurance) of [C_CampSales] field.

or alsso try this

if([C_CampSales] = 'NameInsurance',$(vAcceptedCurrentYearDirectNoMissing))

Gysbert_Wassenaar

If C_CampSales is a field then try:

if(C_CampSales='NameInsurance', $(vAcceptedCurrentYearDirectNoMissing))

But if C_CampSales is a cylcic group or a drilldown group try:

if(GetCurrentField(C_CampSales) = 'NameInsurance', $(vAcceptedCurrentYearDirectNoMissing))


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks vishwaranjan, but unfortunately it didn't work.

C_CampSales is a group that includes two dimensions: NameInsurance and campaign.

I would like to be able to switch between these dimensions in my table.

It will also be a seperate expressions for each dimension:

if(GetCurrentField([C_CampSales]) = 'NameInsurance',

$(vAcceptedCurrentYearDirectNoMissing),

$(vAcceptedCurrentYearDirect))

Is that possible?

Not applicable
Author

That's right it's a cyclic group and I tried:

if(GetCurrentField(C_CampSales) = 'NameInsurance', $(vAcceptedCurrentYearDirectNoMissing))

but it's not working.

I have tried GetCurrentField(C_CampSales) in a text object and it gives me NameInsurance

I also tried vAcceptedCurrentYearDirectNoMissing as an expression and it works fine

Gysbert_Wassenaar

Perhaps the expression in your variable needs a dimension to work. The technique works for me. See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi,

what is the expression in your variable (vAcceptedCurrentYearDirectNoMissing). If it starts with equal sigh (=) delete it.When the expression in a variable definition starts with equal sign the variable gets calculated globally.

Yani

Not applicable
Author

thanks Gysbert, but I can't get it to work

This is what I'm working with.

Variables:

vAcceptedCurrentYearDirect= sum( {$<[CurrentYear] = {1}, TypeOfInsuranceCD = {1}, Campaign = {[Name1], [Name2], [Name3]} >} NoOfSales)

vAcceptedCurrentYearDirectNoMissing = sum( {$<[CurrentYear] = {1}, TypeOfInsuranceCD = {1}, NameInsurance = {[Name1], [Name2], [Name3]} >} NoOfSales)

Then I have a table where I want Salesman and campaign to be a group as dim.

Expression:

if(GetCurrentField(C_CampSales) = 'NameInsurance',

$(vAcceptedCurrentYearDirectNoMissing),

$(vAcceptedCurrentYearDirect))

I'm I missing a dimension somewhere?

Gysbert_Wassenaar

This doesn't make sense to me: Campaign = {[Name1], [Name2], [Name3]}. Same for NameInsurance = {[Name1], [Name2], [Name3]}. Unless [Name1] is really something like 'ThisIsAString' then those set modifiers would almost certainly make sure no record matches.

If Name1, Name2 and Name3 are fields then those are you're missing dimensions. You won't get a result unless only one value is selected (or possible) in Name1 and only one value is selected (or possible) in Name2 and only one value is selected (or possible) in Name3.


talk is cheap, supply exceeds demand