Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hi everyone, problem with dates

Hi,

I've a table like that:

Immagine.jpg

I've to count the days that my article "0421j141995" stay in each "Sede".

DEL means Entry and DUL means Exit.

For example this article star from "Sede" 1 for going in "Sede" 6 for staying here for 7 days, then it left "Sede" 6 for going in "Sede" 8 and it stay here for 18 days, etc..

How can I do it in Qlikview or sense?

Thank for everyone can answer.

Best Regards

Miriana

14 Replies
Not applicable
Author

It works!

But it gives me this result..

Senzanome.jpg

Best regards

jopmoekotte
Contributor III
Contributor III

try replacing


  1. [Data]: 
  2. Noconcatenate LOAD *, 
  3.   If(Codice=Peek(Codice) and Sede=Peek(Sede),Date#(Data-Peek(Data),'D')) as Day_nr 
  4. LOAD * RESIDENT Data_temp Order By Codice, Recordnr ASC;

with


  1. [Data]: 
  2. Noconcatenate LOAD *, 
  3.   If(Codice=Peek(Codice) and Sede=Peek(Sede),Date#(Data-Peek(Data),'D'),0) as Day_nr 

RESIDENT Data_temp Order By Codice, Recordnr ASC;

Not applicable
Author

Sorry but with Noconcatenate it gives me this error:

Si è verificato il seguente errore:

Field not found

L'errore si è verificato qui:

[Data]: Noconcatenate LOAD *, If(Telaio=Peek(Telaio) and Sede=Peek(Sede),Date#([Data documento]-Peek([Data documento]),'D'),0) as Day_nr RESIDENT Data_temp Order By Codice, Recordnr ASC

jopmoekotte
Contributor III
Contributor III

Hi Miriana,

It's not the Noconcatenate that gives the issue, you're not loading Codice. If you rename that field you should also order by the new fieldname at the end.

RESIDENT Data_temp Order By Codice, Recordnr ASC


RESIDENT Data_temp Order By Telaio, Recordnr ASC


Kind regards,

Jop

Not applicable
Author

Sorry, I didn't see it.

I've replace Codice with Telaio now, but it gives me the same result of the table I've posted friday.

No matter, I'll do it in another way.

Thank you very much for the help.

Kind Regards

Miriana