Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a tricky situation need help
giving an example of my requirment
I have field 'Type'
Type
A
B
C
D
E
F
If A or B are selected sum(current month sales)/Total sales
if A and B are selected should show combined value
if C or D are selected sum (previous month sales)/ total sales
if C and D are selected should show combined value
If E and F or both are selected there is no calculation so do nothing
and cross selection is done like A and C or B and D and so on do nothing
I have written something like this (please ignore bracket errors and upper/lower case) its working for only one selected value like if one of A/B is selected it works and if A and B are selected shows nothing
similarly if one of C/D is selected it shows value if both are selected shows nothing
need see individual selections and also combined
if(GetFieldSelections([Type]) = 'A' or GetFieldSelections([Type] ) = 'B',((sum ([current month sales]))/ [Total sales]
,
if(GetFieldSelections([Type]) = 'c' or GetFieldSelections([Type] ) = 'D',((sum ([Previous Month sales]))/Total sales
need help on this
Thanks - sravan
Try
if(GetSelectedCount(Type)>0,
if(SubStringCount(Concat(Type, '|'),'A')+SubStringCount(Concat(Type, '|'),'B')>0,
(sum ([current month sales])/ [Total sales],
if(SubStringCount(Concat(Type, '|'),'C')+SubStringCount(Concat(Type, '|'),'D')>0,
sum ([Previous Month sales])/Total sales)),)
Try
if(GetSelectedCount(Type)>0,
if(SubStringCount(Concat(Type, '|'),'A')+SubStringCount(Concat(Type, '|'),'B')>0,
(sum ([current month sales])/ [Total sales],
if(SubStringCount(Concat(Type, '|'),'C')+SubStringCount(Concat(Type, '|'),'D')>0,
sum ([Previous Month sales])/Total sales)),)
Hi Wallo,Thanks for the reply
It actually worked , i should say almost
if i select A or B or both i get the result thats what i want but if i select A and C or A and D and so on then also its showing the values which it should not show because A and B are one category and C and D are another
cross selections should not give the result
Thanks- sravan
Do you have a field in the data that groups the Types together? Something like
Type Group
A 1
B 1
C 2
D 2
Then you would just add a check for that. Somethiing like
if(GetSelectedCount(Type)>0 and GetPossibleCount(Group)=1,
if(SubStringCount(Concat(Type, '|'),'A')+SubStringCount(Concat(Type, '|'),'B')>0,
(sum ([current month sales])/ [Total sales],
if(SubStringCount(Concat(Type, '|'),'C')+SubStringCount(Concat(Type, '|'),'D')>0,
sum ([Previous Month sales])/Total sales)),)
but where to write this expression with condition ?
In calculation condition inside general tab or in expression tab ?
Depends how you want to see it. I would think you could put it in the expression tab as an expression. Or it could be in a text object.
Or you could put it in an expression and a condition to only show something when rule is met.