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

database column where condtion

Hi,

I need to fetch the column from db where the values lies between 100 to 1000.

the coumn name is Salary and my codition is to fetch the Salary from db where count of salary between 100 and 1000.

how to writhe above while condition while fetching from db with in the script not in the expression part.

provide me the solution

1 Solution

Accepted Solutions
joshabbott
Creator III
Creator III

We probably need a bit more information before we can answer.  Is your datasource a spreadsheet?  Access DB?  SQL Server DB?  No matter what it is, you should be able to get it using a preceding load, add the bolded below:

[Table Name You Define]:

LOAD *;

  ALL OF YOUR LOAD SCRIPT HERE

Where [Plug Your DB Field Name Here] >= 100 and [Plug Your DB Field Name Here] <= 1000;

View solution in original post

9 Replies
ashfaq_haseeb
Champion III
Champion III

Hi try below

Load

EMPID,

Ename,

Salary;

sql select *  from table

Where Salary >100 and Salary <1000;

Regards

ASHFAQ

jjordaan
Partner - Specialist
Partner - Specialist

Hi,

You can use a query like;

SELECT

     Field1

     ,Field2

     ,COUNT(Salary)

FROM table

WHERE Field3 = ?? (if you need to filter)

GROUP BY Field1, Field2

HAVING COUNT(Salary) >= 100 AND COUNT(Salary) <= 1000.

Hope this helps

senpradip007
Specialist III
Specialist III

Try like:

Select * from [Your Table] where salary between 100 and 1000;

vardhancse
Specialist III
Specialist III

we can write the where condition after table name.

Not applicable
Author

Hi Guys ,

its not working can you check from your end

jjordaan
Partner - Specialist
Partner - Specialist

Do you receive an error?

Can you be a bit more specific

joshabbott
Creator III
Creator III

We probably need a bit more information before we can answer.  Is your datasource a spreadsheet?  Access DB?  SQL Server DB?  No matter what it is, you should be able to get it using a preceding load, add the bolded below:

[Table Name You Define]:

LOAD *;

  ALL OF YOUR LOAD SCRIPT HERE

Where [Plug Your DB Field Name Here] >= 100 and [Plug Your DB Field Name Here] <= 1000;

Not applicable
Author

Josh Abbott,

Thanks for your solution.

Your approach is correct.

Thank you

Not applicable
Author

Hi please close the question and make it as correct answer