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

Load statement "between"

Hi im struggling with a sql load statement    

i would like to load the following

SELECT * FROM KONTO    

WHERE     (KontoNr BETWEEN 5900 AND 5999)

                   AND KontoNr BETWEEN 3000 AND 3010;

How do i create this in the load script.

Second question is how to sum a specific range / interval in a expression like below

Sum ( {$ <Booked.Year = {'2016'},Booked.Month = {apr,maj,jun},Konto = {<='5900' and >='5999'}>}, Konto = {<='3000' and >='3010'}  Amount)

Thx in advance

1 Solution

Accepted Solutions
sunny_talwar

Or even this should work:

Sum({$<Booked.Year = {'2016'}, Booked.Month = {apr,maj,jun}, Konto = {'<=5900 >=5999', '<=3000>=3010'}>} Amount)

View solution in original post

5 Replies
PrashantSangle

Hi,

I think you need OR here

SELECT * FROM KONTO   

WHERE     (KontoNr BETWEEN 5900 AND 5999)

                   OR KontoNr BETWEEN 3000 AND 3010;

REgards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

For 2nd query try like

Sum ( {$ <Booked.Year = {'2016'},Booked.Month = {apr,maj,jun},Konto = {<=5900 >=5999}>+<Booked.Year = {'2016'},Booked.Month = {apr,maj,jun},Konto = {<=3000>=3010} >} Amount)


Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
trdandamudi
Master II
Master II

Qlikview doesn't have the 'Between' function, so you can use the below:

Data:

Load

*

From <Your Table Name >

Where KontoNr>=5900 and KontoNr <=5999 OR KontoNr >=3000 And KontoNr <=3010;

sunny_talwar

Or even this should work:

Sum({$<Booked.Year = {'2016'}, Booked.Month = {apr,maj,jun}, Konto = {'<=5900 >=5999', '<=3000>=3010'}>} Amount)

harjedalskok
Creator
Creator
Author

Both Thirumala And Sunny T had correct answers.

Thx alot for fast respons.

Take care.