Hi,
I'm having a set analysis with alternate sates where I have show data of 2 different data types, Both number and string
Here is what i'm using,
MaxString({[state1]<field1={1}>}value)+sum({[state1]<field1={2}>}value)
since data is of 2 different data types set analysis is not performing OR operation.
Other way i'm trying is using if condition but not sure how to use alternate states in if condtion.
Any suggestions?
I did that mark, But you cannot concatenate in front end right? that ends up again as two different data types
Hi,
IF you do your calculation as normal with the numbers and ignore the special char, once you are happy with the result you can add an if to your set analysis like
'Your Set analysis'&IF(SUM(Special)= 1,'*')
Or even have a different way to visualise it, with a coloured text or field.
I tried even concatenating.
I used something like
(sum({[state1]<F3={1}>}value1)&'*')
+
sum(F3={2}>}value).
Even this is not working
HI,
You won't be able to sum a string and num. The only way it will work is to do you calculation first and then add the special character on afterwards. So above would be something like
(sum({[state1]<F3={1}>}value1)
+
sum(F3={2}>}value)&'*')
Mark
The one you have written will append for entire expression. * has to come up only when F3 is 1. I cannot append * for entire expression. Would need only for this expression
sum({[state1]<F3={1}>}value1)&'*'
For this data that you have provided
load * Inline [
F1, F2.F3
abc, 9*,1
def, 10,2
ab, 100,2
];
What should the final output look like?
Hi Swe,
Yes it would I was just using your example, but as I was trying to explained in the pervious post, if you flag the fields in the data that have a special character you can then us an if statement to add the * back in where need
(sum({[state1]<F3={1}>}value1)
+
sum(F3={2}>}value)& IF(Special= 1,'*')
you may need something like IF(ONLY(Special)= 1,'*')
Hi Sunny,
Something like this. Final output filed will have both number and strings
So if the data would have looked like this
load * Inline [
F1, F2.F3
abc, 9*,50
def, 10,2
ab, 100,2
];
then it would be 450* for abc? If that is true... may be you need this
KeepChar(F2, '0123456789') * F3 & PurgeChar(F2, '0123456789')
No.
There are alternate states too.
load * Inline [
F1, F2.F3,F4,
abc, 9*,1,9
def, 10,2,10
ab, 100,2,100
];
F3 field tells if there is a special character and F4 is removing the special character
Since there are alternate states I cannot use if condition
sum({[state1]<F3={1}>}F4)
+
sum(({[state2]<F3={2}>}F2)
Now till hear i'm able to display without * by converting to number.
Now if i have to concatenate * to the above expression, is it feasible?I have to concatenate to the first statement.
Which means sum({[state1]<F3={1}>}F4)