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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
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
Partner - Champion III
Partner - Champion III

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.