Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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...

1 Solution

Accepted Solutions
Sokkorn
Master
Master

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

View solution in original post

13 Replies
Not applicable
Author

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
giakoum
Partner - Master II
Partner - Master II

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
Master
Master

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

alexandros17
Partner - Champion III
Partner - Champion III

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

Anonymous
Not applicable
Author

Load

*

FROM

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

Not applicable
Author

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

Not applicable
Author

thanks alessandro...your script is working too!

Not applicable
Author

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
Author

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