Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Contributor

Re: set analysis with 2 different data types

I did that mark, But you cannot concatenate in front end right? that ends up again as two different data types

Highlighted
Partner
Partner

Re: set analysis with 2 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.

Highlighted
Contributor

Re: set analysis with 2 different data types

I tried even concatenating.

I used something like

(sum({[state1]<F3={1}>}value1)&'*')

+

sum(F3={2}>}value).

Even this is not working

Highlighted
Partner
Partner

Re: set analysis with 2 different data types

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

Highlighted
Contributor

Re: set analysis with 2 different data types

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)&'*'

Highlighted

Re: set analysis with 2 different data types

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?

Highlighted
Partner
Partner

Re: set analysis with 2 different data types

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,'*')

Contributor

Re: set analysis with 2 different data types

Hi Sunny,

Something like this. Final output filed will have both number and strings

Highlighted

Re: set analysis with 2 different data types

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')

Highlighted
Contributor

Re: set analysis with 2 different data types

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)