Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
MuraliPrasath
Creator III
Creator III

SQL where Question.

Hi,

I need to restrict

where YEAR = 2015 and 2016.

how to do this in qlikview.

1 Solution

Accepted Solutions
Kushal_Chawda

If you want to restrict it while loading the data from database then do it like below

Data:

SQL SELECT *

FROM Tablename

where YEARFIELD IN ('2015','2016');

STORE Data into path\Tablename.QVD;

DROP TABLE Data;

if you want to restrict this in Qlikview script

Data:

LOAD *

FROM Tablename.QVD(QVD)

WHERE match(YEARFIELD,'2015','2016');

If you want to restrict at chart level use the below expression

=sum({<YEAR ={'2015','2016'}>Value)

View solution in original post

6 Replies
Not applicable

You can add it in script almost like SQL.

LOAD *

FROM

YourQVDHere.qvd

(qvd)

where(year = ('2015') or year = ('2016'));

Gysbert_Wassenaar

Where do you want to restrict this? In a chart or with loading the data?


talk is cheap, supply exceeds demand
Anil_Babu_Samineni

Niklas. Might be he want, 2015 and 2016 data..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable

SELECT *

  FROM table

WHERE YEAR IN (2015, 2016);

Kushal_Chawda

If you want to restrict it while loading the data from database then do it like below

Data:

SQL SELECT *

FROM Tablename

where YEARFIELD IN ('2015','2016');

STORE Data into path\Tablename.QVD;

DROP TABLE Data;

if you want to restrict this in Qlikview script

Data:

LOAD *

FROM Tablename.QVD(QVD)

WHERE match(YEARFIELD,'2015','2016');

If you want to restrict at chart level use the below expression

=sum({<YEAR ={'2015','2016'}>Value)

MuraliPrasath
Creator III
Creator III
Author

WHERE match(YEARFIELD,'2015','2016');



This is worked.  thanks Kishal.