Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to do RowWise multiplication

Hello Everyone,

I have a table:

DF1F2F3F4F5
A435211
B65376
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.

5 Replies
datanibbler
Champion
Champion

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

juleshartley
Specialist
Specialist

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?


maxgro
MVP
MVP

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;

Anonymous
Not applicable
Author


Hi Julian,

There is only one dimension D and within that there are values A, B and C.

Anonymous
Not applicable
Author


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.