Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
markthepig
Contributor
Contributor

Issue with do/loop and date field

Dear community

I'm a beginner so this is something very simple ,but i cannot think of a way to do it right.

So. Let me explain what problem i have.

I have an excel document that have the following rows

DATACatClient
9/5/2012dune inc
9/18/2012salso inc
9/17/2012babmoo inc
9/21/2012alcor ltrd
9/19/2012sumo ltd
9/26/2012elmo ltd
8/31/2012dreasos ltd
8/31/2012G&Galtor
9/30/2012LIPEST COM
9/21/2012MACSL COM
8/31/2012NXCO DISTRL COM
10/11/2012OFFIL COM
9/5/2012PROSA COM
9/22/2012PRMLAC COM
9/20/2012SERSCOM
10/25/2012TERCT COM
9/12/2012COMBI COMIMPEX SRL -COM

my qlikview script

xcel:

LOAD

    rowno() as row,

    DATA,

    CatClient

FROM c:\!\data.xls (biff, embedded labels, table is [Sheet1$]);  (,<- this is the excel above)

let RO = peek('Rand');

do

let cat = fieldvalue('CatClient',$(RO));

let dta  = fieldvalue('DATA',$(RO));

Base:

LOAD

    CodProd,

    Data,

    Tip,

    Pice,

    qty,

    CateClienti

FROM c:\!\Base.qvd (qvd) where CateClienti = '$(cat)' and DATA >= '$(dta)' ';

let RO = RO - 1;

loop while $(RO) > 0

drop table xcel;

For the clients that have same dates (it only works for the firs one). I'm talking about the ones from the excel file.

ex:8/31/2012  dreasos ltd  (it takes in consideration (where CateClienti = '$(cat)' and DATA >= '$(dta)' ';)

but for the rest G&Galtor and NXCO DISTRL COM (takes in consideration only CateClienti = '$(cat)' but not the date)

The issues is clearly with the dates being the same. But i cannot understand why.

Hope i explain my issues to your understanding.

Thank you for taking time to read my post.

Yours

mark

0 Replies