Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Create filter from calculated field

Hi guys,

          this is the situation, i've a table like this

idinoutresult
a14113
b1723-6
c865630
d433211

this is the load script:

LOAD id,

          in,

          out

FROM ....

and result = in - out

Now i'd like a filter where i can group the result value, for example:

result < 0

result > 0 and result < 10

result > 10 and result < 20

result > 20 and resul < 30

so i can filter only the values that i want.

Can i create a filter on the calculated field "result"?

10 Replies
gerry_hdm
Creator II
Creator II

it's going with Intervallmatch()

Greetings gerry

chinnuchinni
Creator III
Creator III

try this:

if ( in - out< 0,'result < 0',if(in - out> 0 and in - out< 10, 'result > 0 and result < 10', if(in - out> 10 and in - out< 20,'result > 10 and result < 20',if(in - out> 20 and in - out< 30,'result > 20 and result < 30')))) as Result status

sunny_talwar

Look here

Buckets

Anonymous
Not applicable
Author

I can't use Intervallmatch() because i create the result field with Straight Table and not on load

MarcoWedel

maybe something like

Class(YourStraightTableResultExpression, 10)

hope this helps

regards

Marco

qv_testing
Specialist II
Specialist II

Try this...

Load *, IF(result<0, 'lesthan0',

IF(result>0 and result<=10, '0-10',

IF(result>10 and result<=20, '11-20',

IF(result>20 and result<=30, '21-30')))) as ResultBucket;

LOAD * INLINE [

    id, in, out, result

    a, 14, 11, 3

    b, 17, 23, -6

    c, 86, 56, 30

    d, 43, 32, 11

];

Anonymous
Not applicable
Author

try this:

LOAD*,

in-out as result;

LOAD * INLINE [

    id, in, out

    a, 5, 3

    b, 22, 4

    c, 6, 7

    d, 8, 4

    e, 19, 6

    f, 7, 8

];

take a list box an write a below expression in the field <exp>

=if(result<0,'result<0',if((result > 0 and result < 10),'result>0 and result<10',if((result>10 and result<20) ,'result > 10 and result < 20','result>20')))

sasiparupudi1
Master III
Master III

May be like this?

effinty2112
Master
Master

Hi Andrea,

Try this as an expression in a listbox:

=Aggr('<=' & 10*Ceil((in-out)/10),id)

Cheers

Andrew