cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Loc function

hcarr01
Level VI

Hello everyone,

In a data table, I have two columns: Number & Code

Using the "Loc" function I search for indices in the data table.

Names default to here(1);

dt = current data table();

VALEUR = Loc( dt[Row(), "Numéro"], 1);
// VALEUR1 = Loc( dt[Row(), "Numéro"], 1) & Loc( dt[Row(), "Code"], "A") ;

How can we apply the "Loc" function with a double condition (I tried with "AND").

Thank you for your reply.

This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User


Re: Fonction Loc

I suggest using "Get Rows Where"

Names default to here(1);

dt = current data table();

VALEUR = dt << get rows where( :Numéro == 1 & :Code == "A" );
Jim

View solution in original post

jthi
Super User


Re: Fonction Loc

And if you have JMP18 you can use new Where()

And if you have JMP18, new Where()

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
rs = Where(dt, :sex == "F" & :age == 12);


-Jarmo

View solution in original post

2 REPLIES 2
txnelson
Super User


Re: Fonction Loc

I suggest using "Get Rows Where"

Names default to here(1);

dt = current data table();

VALEUR = dt << get rows where( :Numéro == 1 & :Code == "A" );
Jim
jthi
Super User


Re: Fonction Loc

And if you have JMP18 you can use new Where()

And if you have JMP18, new Where()

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
rs = Where(dt, :sex == "F" & :age == 12);


-Jarmo