Lookup Functions in DIAL

The lookup functions in DIAL access data defined in external Lookup Files, which are comma- or tab-delimited tables of data.

Lookup Example

The following script connects to the Diveline Server, opens the an_sales.dvp DivePlan and the an_salesmanagerlu.txt lookup file. It then dives into and walks the Sales Manager dimension in the sales model and calculates the percent variance from the Q1 Goal. This information is then written to the console.

diveline.connect("docs.dimins.com:2130","dial_user","dial_user");

diveline.set_project("myProject");

model.open(model,"/models/an_sales.dvp");

lookup.open(manager_lu, "/di/projects/myProject/data/an_salesmanagerlu.txt", "Sales Manager", "delim=tab");

dive (model, "Sales Manager") {

walk (model, "Sales Manager") {

if (lookup.defined(manager_lu) AND manager_lu."Q1 Goal" != "") {

Q1_Pct_var = pct_var(calc[Revenue Total Q1],manager_lu."Q1 Goal");

console.writeln (Dimension[Sales Manager]);

console.writeln (" Goal: "+format_number(manager_lu."Q1 Goal","$##,##0.##"));

console.writeln (" Variance:"+format_number(Q1_Pct_var,"##,##0.00")+"%");

}

else {

console.writeln ("Goal not defined for Sales Manager: \t" +Dimension[Sales Manager]);

}

console.writeln(" ");

}

}

diveline.disconnect();

ClosedSample lookup table

DIAL sample lookup table

ClosedSample output

DIAL lookup example output