Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
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..

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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)

View solution in original post

MuraliPrasath
Creator III
Creator III
Author

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



This is worked.  thanks Kishal.