Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I have a table:
D | F1 | F2 | F3 | F4 | F5 |
---|---|---|---|---|---|
A | 4 | 3 | 5 | 2 | 11 |
B | 6 | 5 | 3 | 7 | 6 |
C | =24(4*6) | =15(3*5) | =15(5*3) | =14(2*7) | =66(11*6) |
Can any one help me to get above value for C.
Hi Nita,
generally, you can use the PEEK() or the PREVIOUS() functions in QlikView to access any previously loaded records within a table. It's in the help file.
You just have to be careful in case you have to build such a function in the very first record - there, both those functions will fail as there is no previously loaded record.
HTH
Best regards,
DataNibbler
Hi,
You need to give us a bit more detail about the table. Are the 'A', 'B' values different dimensions? Or values within one dimension? Or different expressions?
t:
LOAD D, F1, F2, F3, F4, F5,
if(peek(D)<>D, F1*peek(F1)) as F11,
if(peek(D)<>D, F2*peek(F2)) as F22,
if(peek(D)<>D, F3*peek(F3)) as F33,
if(peek(D)<>D, F4*peek(F4)) as F44,
if(peek(D)<>D, F5*peek(F5)) as F55
FROM [http://community.qlik.com/thread/124458] (html, codepage is 1252, embedded labels, table is @1)
where D<>'C';
Concatenate (t)
load 'C' as D,
F11 as F1, F22 as F2, F33 as F3, F44 as F4, F55 as F5
Resident t
where D = 'B';
DROP field F11, F22, F33, F44, F55;
Hi Julian,
There is only one dimension D and within that there are values A, B and C.
Thanks to everyone for your valuable reply. Same thing I need to do in Level 3 for a pivot chart. In that case, I think, i wont be allowed to user Peek or previous function.
Also F1, F2, F3... etc refers to year( I am sorry not to clearly mention it), so F1=2001, F2=2002.. etc.
Is there any modification I can do on chart to retrieve the value for C.
Many Many thanks to all for your answers.