Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Obtain one value

Hi,


I need to use a macro to select just one value from a SQL Server Database or a can obtain information direct from the memory?

What's the best way to do that?

Exemple:
SELECT @VariableName = name FROM users WHERE nif = 123

Which code I have to use?

Could you send me a exemple or a qlik file that explain what to do?

Thank you so much.
Regards,
Nuno Maximiano.

1 Solution

Accepted Solutions
Not applicable
Author

Before running the macro, you can put the value in a variable and use the variable in the macro.

View solution in original post

5 Replies
pat_agen
Specialist
Specialist

hi,

try the following:

users:

sql select name as NAME

from

users WHERE nif = 123;

let vVariableName=peek('NAME',-1,users);

drop table users;

Not applicable
Author

The goal is to have a button on the screen to validate that the NIF input by user (in input box) exists in the database.

Any Ideas?

Not applicable
Author

You can try this.


Only({$<nif={$(vNifInput)}> Name}

Best Regards.
Tonial.

Not applicable
Author

But i need to use a macro...

Any ideias?

Not applicable
Author

Before running the macro, you can put the value in a variable and use the variable in the macro.