Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
KaisGarci
Contributor III
Contributor III

Loading two files from different dates

Hi everyone, 

I am new to qlikview. I have two excel files containing sales of different dates ( week of 07/27 and week of 08/03). I want to create a table that display both sales.

Can anyone help me please ?

Thank you 

2 Solutions

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

you misunderstood . you mention weeks  week of 07/27 and week of 08/03

i am assuming this will change dynamically . is that fair?

if so use a script something like below. (i am assuming you want to load last 2 weeks) i.e. Test 08-03-2020.xls and Test 07-27-2020.xlsx

let vLastWeek = Date(weekstart(today(),0,0)-7,'MM-DD-YYYY');
Sales:
LOAD ID, 
     Sales, 
     Date(weekstart(today(),0,0)-7,'MM-DD-YYYY') as Week
FROM
[..\Downloads\Test $(vLastWeek).xls]
(biff, embedded labels, table is Sheet1$);

let v2Week = Date(weekstart(today(),0,0)-14,'MM-DD-YYYY');
concatenate(Sales)
LOAD ID, 
     Sales, 
     Date(weekstart(today(),0,0)-14,'MM-DD-YYYY') as Week
FROM
[..\Downloads\Test $(v2Week).xls]
(biff, embedded labels, table is Sheet1$);

if you give me the sample excels i can tweak it to your specification

View solution in original post

dplr-rn
Partner - Master III
Partner - Master III

You can do that in a pivot table and move week to column.

you could do it script too but i would not recommend it as data model becomes less flexible.

View solution in original post

6 Replies
dplr-rn
Partner - Master III
Partner - Master III

Does the dates change?

Share the names of the files. sample of the contents.

 

 

KaisGarci
Contributor III
Contributor III
Author

Thank you for responding 

Yes sales vary from one week to another. I want to put them in a table in order to see the difference. 

dplr-rn
Partner - Master III
Partner - Master III

you misunderstood . you mention weeks  week of 07/27 and week of 08/03

i am assuming this will change dynamically . is that fair?

if so use a script something like below. (i am assuming you want to load last 2 weeks) i.e. Test 08-03-2020.xls and Test 07-27-2020.xlsx

let vLastWeek = Date(weekstart(today(),0,0)-7,'MM-DD-YYYY');
Sales:
LOAD ID, 
     Sales, 
     Date(weekstart(today(),0,0)-7,'MM-DD-YYYY') as Week
FROM
[..\Downloads\Test $(vLastWeek).xls]
(biff, embedded labels, table is Sheet1$);

let v2Week = Date(weekstart(today(),0,0)-14,'MM-DD-YYYY');
concatenate(Sales)
LOAD ID, 
     Sales, 
     Date(weekstart(today(),0,0)-14,'MM-DD-YYYY') as Week
FROM
[..\Downloads\Test $(v2Week).xls]
(biff, embedded labels, table is Sheet1$);

if you give me the sample excels i can tweak it to your specification

KaisGarci
Contributor III
Contributor III
Author

Thank you, this loaded sucessfully. 

But could you tell me the expression that I have to write to display Sales of this week and sales of previous week ? 

To be more simple, I want a table like this: 

ID                   Sales(Week07/27)                         Sales(Week08/03)

*                               ****                                                    ****

'***' are numbers .

Thank you. 

dplr-rn
Partner - Master III
Partner - Master III

You can do that in a pivot table and move week to column.

you could do it script too but i would not recommend it as data model becomes less flexible.

KaisGarci
Contributor III
Contributor III
Author

Thank you a lot, I will try it