Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
];
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??????
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.
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
];
Hi Richard
You are best. Thank you very much.
Best regards
Muncho
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.