Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

SQL AND EXCEL QUESTION

Hello community, I Have the next question :

   - In m y script i have two diffetent data providers, one from Sql server and other from an excel file, they both have 1 field in commun

so im trying something like this to make them match, becouse i just need the row from the excel that match with the data in the Sql sentence.

script.png

when I run the script its run with no problem, so I made a table to check what was the Nis i was getting from sql

and what was the current value stored in the Variable vCurrency to check if they match or no

like this

excel.png

as you can see they match but I dont get data from in the table of the excel, and if i check the excel the current nis (571105) exist , so i dont know whats wrong Help Please.

1 Solution

Accepted Solutions
big_dreams
Creator III
Creator III

why don't you use simple

where exists()

try like

Your current SQL query

sql select

...

...

from ...

Excel:

Load * from excel

where exists(cd_nis,nis)

Regards

View solution in original post

4 Replies
shiveshsingh
Master
Master

I think, after storing the DB data into QVD, you need to left join it with Excel data on that column. Make sure your field name in excel matches with DB filed name.

It should work.

Can you show your Table structure?

jonathandienst
Partner - Champion III
Partner - Champion III

Looks like you are trying to set the variable vCurrency to the minimum cd_nis value in script. However, this expression will not be evaluated in the script. It will only be evaluated in the front end when the script is finished.

You need to Peek() the value from the table, like this:

SQLTable:

SQL SELECT ....

Min_NIS:

LOAD MinString('cd_nis') as Min_NIS

Resident SQLTable;

Let vCurrency = Peek('Min_NIS');

DROP Table Min_NIS;

...


Now use vCurrency as before.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
big_dreams
Creator III
Creator III

why don't you use simple

where exists()

try like

Your current SQL query

sql select

...

...

from ...

Excel:

Load * from excel

where exists(cd_nis,nis)

Regards

Anonymous
Not applicable
Author

Thanks for yor answer Jonathan its works but Max payne solution was easier and fast to do.