Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
mario-sarkis
Creator II
Creator II

Bracket issue

i need to compare two brackets, to find out wich one is bigger example [100-200]>[50-100]

this is how my bracket look like :

>8000,000
01-25,000
25,001-75,000
75,001-100,000
100,001-200,000
500,001-1000,000
600,001-8000,000
1000,001-2000,000
2000,001-4000,000
4000,001-6000,000

i loaded All my fields in the script

but this gave me an empty Field>>>> Dual(brack1, (Num#(TextBetween(brack1, '[', '-'), '##') + Num#(TextBetween(brack1, '-', ']'), '##'))/2) as brack1,

can you help ?

3 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

There are no square brackets in your example data (or you removed them).

Care to post your entire script and some real data as an example?

Peter

swuehl
MVP
MVP

Besides Peter's comment, what defines 'bigger' in your context?

I first assumed that bigger means the interval contains more integers i.e. I would calculate it as difference of

upper limit of bucket - lower limit of bucket

It seems you are trying to calculate the mean value. Does this define the 'Bigness'?

A second comment: You could also run into troubles using the num#() function, if your format code and the decimal and thousand separator are not well defined (or if the separators in your default settings are different from ones used in the input table records). It might be better to define them explicitely:

Dual(brack1, (Num#(Subfield(brack1, '-',1), '###,###',',','.') + Num#(Subfield(brack1, '-',2), '###,###',',','.'))/2) as brack1,

anbu1984
Master III
Master III

Duplicate post Set Analysis