Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Quick Answers!

Hello to all community!

My questions are quite easy but it is quite important for me and for newbee guys...So your replies quite useful for all starter users..

My problems are adding condition while loading data from source...I dont wanna go to database to add condition and limit  the size of data...I need to learn 2 issues which are quite important when we make reports..

First one;

I would like to use only column A and I need only X and Y from column while loading data..How can I write a sciprt when I reload it whole data and select those conditions? (I have tried where condition but dont know why it doesnt fix it up )

Second one:

How can I select date range from DATE column while loading data?

For example I would like to see only date from 01-01-2014 and 05-01-2014?

I have uploaded a test qwv and if you reply me in a short time I really would be appreciated in you..

Thanks for replying me...

Tags (3)
1 Solution

Accepted Solutions
Sokkorn
Honored Contributor

Re: Quick Answers!

Hi,

For question number one:

LOAD [COLUMN A],

     [COLUMN B],

     DATE

FROM

(ooxml, embedded labels, table is Sheet1) Where WildMatch([COLUMN A],'*X*','*Y*');

For number two:

LOAD [COLUMN A],

     [COLUMN B],

     DATE

FROM

(ooxml, embedded labels, table is Sheet1)

Where DATE >= Date(Date#('01-01-2014','dd-MM-yyyy')) And DATE <= Date(Date#('05-01-2014','dd-MM-yyyy'));

Is it possible to upload your excel file?

Regards,

Sokkorn

13 Replies
Not applicable

Re: Quick Answers!

I need to change the columns like which are uploaded a sample table.I need to select X from current COLUMN A while reloading data and I need to select date range such as from 01/01/2014-03/01/2014..

COLUMN ACOLUMN BDATE
X,Y,Z51/1/2014
Y,Z,X102/1/2014
Z,X,Y153/1/2014
A204/1/2014
B255/1/2014
C306/1/2014
M357/1/2014
N408/1/2014
K459/1/2014
Partner
Partner

Re: Quick Answers!

data:

LOAD

  *

Where

  [COLUMN A]='X'

  and [DATE] >= '3/1/2014'

  and [DATE] <= '7/1/2014';

LOAD [COLUMN A],

     [COLUMN B],

     DATE

FROM

(ooxml, embedded labels, table is Sheet1);

This is a load over a load, as you cannot directly place where condition.

Sokkorn
Honored Contributor

Re: Quick Answers!

Hi,

For question number one:

LOAD [COLUMN A],

     [COLUMN B],

     DATE

FROM

(ooxml, embedded labels, table is Sheet1) Where WildMatch([COLUMN A],'*X*','*Y*');

For number two:

LOAD [COLUMN A],

     [COLUMN B],

     DATE

FROM

(ooxml, embedded labels, table is Sheet1)

Where DATE >= Date(Date#('01-01-2014','dd-MM-yyyy')) And DATE <= Date(Date#('05-01-2014','dd-MM-yyyy'));

Is it possible to upload your excel file?

Regards,

Sokkorn

Re: Quick Answers!

There are several ways in which you can avoid loadind of columns if you have for example

     Select col1, col2, col3, ... , coln from ... and you need only col1 and col2 then write Select col1, col2 from ...

     in this way dring the loading you can access all other columns in where conditions so you may write

Select col1, col2 from ... where (myDate >= '2014/01/15' and myDate <=  '2014/01/20')

You have to pay attention to date format (depending on the format you use)

Hope it helps

michael_gardner
Contributor III

Re: Quick Answers!

Load

*

FROM

WHERE [COLUMN A] = 'X' or [COLUMN A] ='Y' and DATE >= '01/01/2014' and DATE <= '05/01/2014';

Not applicable

Re: Quick Answers!

Thanks Sokkorn for replying me...It has worked finally...you are big man!  lol

Not applicable

Re: Quick Answers!

thanks alessandro...your script is working too!

Not applicable

Re: Quick Answers!

Thanks all guys! It is quite important knowledge for freshers and I know that many guys will check out your replies....thanks for nice collaboration!

Not applicable

Re: Quick Answers!

hi Sokkorn,

I have applied to my report and I havent got the result...where is the mistake if my data and sciprt like below;

LOAD [COLUMN A],

     [COLUMN B],

     DATE

FROM

(ooxml, embedded labels, table is Sheet1)

Where Match([COLUMN A],'Y');

and my data ;

COLUMN ACOLUMN BDATE
X,Y51/1/2014
Y,Z102/1/2014
Z,A153/1/2014
A,Y204/1/2014
B,Y255/1/2014
C,X306/1/2014
M,Y357/1/2014
N,Y408/1/2014
K,Y459/1/2014