Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Does anyone know what could be wrong with this.
When I load this file the KeyQN gets wrong value.
Thanks.
LOAD
num(Dealer_LOCAL_DEALER_NUMBER,'#####') as Dealer,
Quotation_QUOTATION_NUMBER as QUOTATION_NUMBER,
Date#(Right(Quotation_LAST_CHANGE,4) &'-' &
right(left(Quotation_LAST_CHANGE,5),2) & '-' &
left(Quotation_LAST_CHANGE,2),'YYYY-MM-DD') as LAST_CHANGE,
num(Dealer_LOCAL_DEALER_NUMBER,'#####') &':'&
Quotation_QUOTATION_NUMBER &':'&
Date#(Right(Quotation_LAST_CHANGE,4) &'-' &
right(left(Quotation_LAST_CHANGE,5),2) & '-' &
left(Quotation_LAST_CHANGE,2),'YYYY-MM-DD') as Key,
num(Dealer_LOCAL_DEALER_NUMBER,'#####') &':'&
Quotation_QUOTATION_NUMBER as KeyQN
FROM C:\QlikView\Data_files\SA3_FI.qvd (qvd)
;
| Dealer | QUOTATION_NUMBER | LAST_CHANGE | Key | KeyQN |
|---|---|---|---|---|
| 7560 | 1412 | 2009-10-23 | 7560:1412:2009-10-23 | 7581:152 |
| 7560 | 1412 | 2009-12-23 | 7560:1412:2009-12-23 | 7581:152 |
| 7561 | 1352 | 2010-02-05 | 7561:1352:2010-02-05 | 7581:152 |
| 7580 | 212 | 2010-02-17 | 7580:212:2010-02-17 | 7581:152 |
| 7581 | 152 | 2010-02-05 | 7581:152:2010-02-05 | 7581:152 |
I tried with the following script, it works fine. I think this will help u in solving ur problem.
Regards,
Jagan.
Sorry,
I forgot to paste the script, pls ignore the last script.
Temp:
LOAD
A,
B,
Num(A,'####') & ':' & Num(B,'####') AS Concat;
LOAD * INLINE [
A, B
456, 422
1234, 4985
1232, 3438
1232, 3482
3422, 383
342, 342
];
I found out what is wrong, but I don´t understand why.
If I put an extra ':' at the end of Key-field it works.
Here is the script
Key and Key3 and Key4 is right but not Key2 and KeyQN
Temp:
LOAD
A,
B,
C,
A & ':' & B & ':' & C as Key,
A & ':' & B as Key2,
Num(A,'#####') & ':' & B & ':' as Key3,
Num(A,'#####') & ':' & Num(B,'#####') & ':' as Key4,
Num(A,'#####') & ':' & Num(B,'#####') as KeyQN;
LOAD * INLINE [
;
LOAD * INLINE [
;
A, B, C
;
7560, 1412, 2009-10-23
;
7560, 1412, 2009-12-23
7561, 1352, 2010-02-05
7580, 212, 2010-02-17
7581, 152, 2010-02-05
];