Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
This is my data:
LOAD * INLINE [
F1, F2
A, 1
B, 2
C, 3
D, 4
];
this is my expression: SUM({$<F1={'A','B','C','D'}>} F2), which gives me 10 all the time no matter I choose either one of F1 or all of them.
I want: when I choose A, the expression gives me 1; when I choose B, the expression gives 2; when I choose nothing, the expression gives me 10. How do I do that? Thanks!
SUM({$<F1={'A','B','C','D'}>*<F1=P(F1)>} F2)
=sum(F2)
I wasn't clear about my rule:
Suppose there are 5 elements, ABCDE, and ABCD are the ones I want to restrict to:
LOAD * INLINE [
F1, F2
A, 1
B, 2
C, 3
D, 4
E, 5
];
I want an expression that when E is selected, the answer is 0. SUM(F2) will give me 5 when E is selected. Thanks.
if I understood right you want to exclude at all time "E", but allow F1 to be "dynamic" , this should do it
=sum({<F1= {'$(=(concat({<F1-={'E'}>}F1,chr(39)&','&chr(39))))'} >}F2)
=sum(if(F2<>'E',F2,0))
Something like the attached?
Maybe something like this:
Let's say I have a list of ABCD. When I select something in F1, only what in the list gets calculated. I could have other F1 values EFG....which I don't care, and the expression should be 0.
sum({<F1=>}F2)
SUM({$<F1={'A','B','C','D'}>*<F1=P(F1)>} F2)