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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Map values in a range

I remember QlikView has such function, but I forgot where I saw it.

Status_mapping_tab:

Load * inline [

GreaterThan,LessThan,StatusName

0,5,Good

6,10,Normal

10,100,Bad

];

Assume here has a table like above one, which include the value range for performance report.

If the value is in the range (defined as >=GreaterThan and <=LessThan), than value can be mapped to that type.

E,g:

If the web page response time less than 5 second, performance is "Good“, if >=6 and <=10 second, "Normal". Otherwise, ‘Bad'

So, is there any function can be used as FunctionName([Mapping Name], [value]).

E.g:

     FunctionName('Status_mapping_tab', 4.5) = Good

     FunctionName('Status_mapping_tab', 8.5) = Normal

BTW, as I know, mapping & applymap() are used for a single value, instead of range. If I am wrong, please correct me.

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

I think you want to make an IntervalMatch:

MockUpData:

Load round(rand()*100) as ResponseTime autogenerate 30;

Status_mapping_tab:

Load * inline [

GreaterThan,LessThan,StatusName

0,5,Good

6,10,Normal

10,100,Bad];

IntervalMatch:

IntervalMatch (ResponseTime) Load GreaterThan,LessThan resident Status_mapping_tab ;

/HIC

View solution in original post

2 Replies
hic
Former Employee
Former Employee

I think you want to make an IntervalMatch:

MockUpData:

Load round(rand()*100) as ResponseTime autogenerate 30;

Status_mapping_tab:

Load * inline [

GreaterThan,LessThan,StatusName

0,5,Good

6,10,Normal

10,100,Bad];

IntervalMatch:

IntervalMatch (ResponseTime) Load GreaterThan,LessThan resident Status_mapping_tab ;

/HIC

Not applicable
Author

awesome,thx