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

Need Help! How to match this fields.

Hello

I'm totally new in Qlikview. Here's the question.

fields contain:

pack_weight, weight

0,2 0,5

1,5 1

2,4 1,5

bla bla....

i need to match pack_weight to weight field. And pack_weight from database, weight is from excel sheet.

Best regards.

Muncho

1 Solution

Accepted Solutions
richardcripps
Partner - Contributor III
Partner - Contributor III

If I understand what you mean you could try interval match. The TAB A is the pack data with the different weights and the data in the second load script are the bands that those weights need to map to

TAB_A:
LOAD * INLINE [
PACK
0.1
0.2
0.3
1
1.2
0.6
1.4
];

INTERVALMATCH(PACK)
LEFT JOIN(TAB_A)
LOAD * INLINE [
START_WEIGHT, END_WEIGHT
0, 0.49
0.5, 0.99
1, 1.49
1.5, 2
];

LEFT JOIN (TAB_A)
LOAD * INLINE [
START_WEIGHT, END_WEIGHT, BAND
0, 0.49, A
0.5, 0.99, B
1, 1.49, C
1.5, 2, D
];



View solution in original post

6 Replies
ashfaq_haseeb
Champion III
Champion III

hi u can use as keyword eg pack_weight as weight, solves your problem regards ashfaq
Not applicable
Author

Well i got something like this:


if(pack_weight = '< 0.5', dual(pack_weight, 0.5),
if(pack_weight = '0.5-1', dual(pack_weight, 1),
if(pack_weight = '1-1.5', dual(pack_weight, 1.5),
if(pack_weight = '1.5-2', dual(pack_weight, 2)))) as pack_weight;


it seams work. But my data sources are different. So what should i do??????

Not applicable
Author

hello ashfaq

Keyword as is cant solve my problem. The thing is pack_weight under 0.5 need match 0.5, 0.5 - 1 match 1 etc.

But thank you for posted.

richardcripps
Partner - Contributor III
Partner - Contributor III

If I understand what you mean you could try interval match. The TAB A is the pack data with the different weights and the data in the second load script are the bands that those weights need to map to

TAB_A:
LOAD * INLINE [
PACK
0.1
0.2
0.3
1
1.2
0.6
1.4
];

INTERVALMATCH(PACK)
LEFT JOIN(TAB_A)
LOAD * INLINE [
START_WEIGHT, END_WEIGHT
0, 0.49
0.5, 0.99
1, 1.49
1.5, 2
];

LEFT JOIN (TAB_A)
LOAD * INLINE [
START_WEIGHT, END_WEIGHT, BAND
0, 0.49, A
0.5, 0.99, B
1, 1.49, C
1.5, 2, D
];



Not applicable
Author

Hi Richard

You are best. Thank you very much.

Best regards

Muncho

Not applicable
Author

Hi ,

Apart from interval match you can also use "Class" function for the same.

Search in help to find the syntax and how to use it.