Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

lookup function with example pls?

lookup function with example pls?  simple example to understand

thanks in advance

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

SaleLastYear:

Load * Inline

[

  Customer_ID, Sales2012

  A, 500

  B, 600

  C, 700

  D, 400

  E, 1000

  F, 800

];

Sales:

Load *,

  Lookup('Sales2012','Customer_ID', ID,'SaleLastYear') as LYSale

Inline

[

  ID, Month2013, Sales

  A, Jan, 100

  B, Jan, 200

  C, Jan, 300

  D, Feb, 150

  E, Mar, 200

  F, Apr, 100

  A, May, 140

  D, May, 80

  E, May, 100

  F, Jun, 150

];


Now create a straight table with

ID as Dimension

and

SUM(Sales) as Expression 1 For Current Year

SUM(LYSale) as Expression 2 For Last Year...

View solution in original post

7 Replies
luis_pimentel
Partner - Creator III
Partner - Creator III

Review the attached document. Its a good example about lookup function.

Regards,

Luis.

Not applicable
Author

MK_QSL
MVP
MVP

Please check enclosed file...

MK_QSL
MVP
MVP

One More... this will show you this year vs last year sale.

Not applicable
Author

i am using personal edition i can not open that file pls share some other file

Not applicable
Author

Hi Manoj,

PFA,

it helps alot i hope.

regards

MAhesh T

MK_QSL
MVP
MVP

SaleLastYear:

Load * Inline

[

  Customer_ID, Sales2012

  A, 500

  B, 600

  C, 700

  D, 400

  E, 1000

  F, 800

];

Sales:

Load *,

  Lookup('Sales2012','Customer_ID', ID,'SaleLastYear') as LYSale

Inline

[

  ID, Month2013, Sales

  A, Jan, 100

  B, Jan, 200

  C, Jan, 300

  D, Feb, 150

  E, Mar, 200

  F, Apr, 100

  A, May, 140

  D, May, 80

  E, May, 100

  F, Jun, 150

];


Now create a straight table with

ID as Dimension

and

SUM(Sales) as Expression 1 For Current Year

SUM(LYSale) as Expression 2 For Last Year...