Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
emyemyemy
Contributor III
Contributor III

Using excel column in sql where clause

 

I want to use the quantity column  from my excel table  in the  sql where clause !

this is the code that i tried  but it didn't work  : 

LOAD   product,Quantity
FROM
[MyFile]
(ooxml, embedded labels, table is Sheet) ;

right join

SQL
select  product
from `DB`.`table` where 
(Quantity - count(product)) <=0 group by  product ;

 

Thanks for any help and attention !

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan

Hi @emyemyemy 

One of the way to achieve based on ApplyMap concept like below. 

MapQuantity:

Mapping Load product,Quantity
FROM
[MyFile]
(ooxml, embedded labels, table is Sheet) ;

 

Load *, where ApplyMap('MapQuantity', product, 0) - ProdCount <= 0;
select  product, count(product) as ProdCount
from `DB`.`table` group by  product ;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
MayilVahanan

Hi @emyemyemy 

One of the way to achieve based on ApplyMap concept like below. 

MapQuantity:

Mapping Load product,Quantity
FROM
[MyFile]
(ooxml, embedded labels, table is Sheet) ;

 

Load *, where ApplyMap('MapQuantity', product, 0) - ProdCount <= 0;
select  product, count(product) as ProdCount
from `DB`.`table` group by  product ;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
emyemyemy
Contributor III
Contributor III
Author

You made my day ,  I have  never woked  with  mapping , I will learn about it more !

Thank you for help !

 

emyemyemy
Contributor III
Contributor III
Author