Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
my input table is like below.
A B C
1 2 3
4 5 6
i need output as
A B C
1 2 3
2 1 3
3 1 2
4 4 6
5 4 6
6 4 5
Please suggest me the logic...
maybe
tmp: // A B C
load * inline [
A, B, C
1, 2, 3
4, 5, 6
];
Concatenate (tmp) load A, B as C, C as B Resident tmp; // A C B
Concatenate (tmp) load A as B, B as A, C Resident tmp; // B A C
Concatenate (tmp) load A as C, B as A, C as B Resident tmp; // B C A
Concatenate (tmp) load A as C, B, C as A Resident tmp; // C B A
Concatenate (tmp) load A as B, B as C, C as A Resident tmp; // C A B
use join between the two table:
Load * From A;
Join
Load * from B;
Hi Rahul,
first table is from my source(input table),
i need to change it with all combinations and store it in qlikview as second table,
so that when we fetch one column data remaining column will have reference.
maybe
tmp: // A B C
load * inline [
A, B, C
1, 2, 3
4, 5, 6
];
Concatenate (tmp) load A, B as C, C as B Resident tmp; // A C B
Concatenate (tmp) load A as B, B as A, C Resident tmp; // B A C
Concatenate (tmp) load A as C, B as A, C as B Resident tmp; // B C A
Concatenate (tmp) load A as C, B, C as A Resident tmp; // C B A
Concatenate (tmp) load A as B, B as C, C as A Resident tmp; // C A B
You can try this, but may be there is a better way:
LOAD * INLINE [
A, B, C
1, 2, 3
4, 5, 6
];
NoConcatenate
NewRows:
LOAD * INLINE [
A, B, C
];
For i = 0 to (NoOfRows('Input')-1)
Let vA = Peek('A', $(i), 'Input');
Let vB = Peek('B', $(i), 'Input');
Let vC = Peek('C', $(i), 'Input');
Concatenate(NewRows)
LOAD * INLINE [
A, B, C
$(vA),$(vC),$(vB)
$(vB),$(vA),$(vC)
$(vB),$(vC),$(vA)
$(vC),$(vA),$(vB)
$(vC),$(vB),$(vA)
];
next
Concatenate(Input)
Load *
Resident NewRows;
drop table NewRows;
Regards,
Angel
Load * Inline [
A,B,C
1,2,3
4,5,6
];
NoConcatenate
B:
Load B As A, A As B, C as C Resident A;
NoConcatenate
C:
Load B As A, C As B, A as C Resident A;
NoConcatenate
😧
Load A As A, C As B, B as C Resident A;
NoConcatenate
Final:
Load * Resident A;
Concatenate
Load * Resident B;
Concatenate
Load * Resident C;
Concatenate
Load * Resident D;
Drop Tables A,B,C,D
Hi Massimo,
Thank you so much its working i got all the combinations....