Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
gorterzelf7
Partner - Creator
Partner - Creator

Scripting challenge

Hello all, 

I have a challenge. I hope there are some clever people here who can help me.

I have for my products a sell date. There are 5 different fases before we can sell the products. The fase lengths are different for each product. 

I would like to calculate my amounts for each fase per product per year/week. So i know which amount in which weeks i got. 

I have tried to make a simulations of the data in excel and an excel with the outcome in QlikView or QlikSense. If somebody would like to try to get the outcome in QlikView or QlikSense and post the app or qvw here, you would be my hero of the day:-) 

With kind regards,

Martijn 

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

I used the following script to create this table:

clipboard_image_0.png

LOAD * inline [
Sell date, Product, Amount
];
for each _letter in 'A','B','C','D', 'E'
Concatenate
LOAD [Sell date], 
     Product, 
     [Fase startdate $(_letter)] as  [Fase startdate] , 
     [Year $(_letter)] as [Year], 
     [Week $(_letter)] as [Week], 
     '$(_letter)' as Fase,
     Amount as [Fase $(_letter)] 
FROM
    [$(vL.ImportPath)\Gorterzelf7.xlsx]
     (ooxml, embedded labels, table is Blad1);

next _letter

View solution in original post

2 Replies
Vegar
MVP
MVP

I used the following script to create this table:

clipboard_image_0.png

LOAD * inline [
Sell date, Product, Amount
];
for each _letter in 'A','B','C','D', 'E'
Concatenate
LOAD [Sell date], 
     Product, 
     [Fase startdate $(_letter)] as  [Fase startdate] , 
     [Year $(_letter)] as [Year], 
     [Week $(_letter)] as [Week], 
     '$(_letter)' as Fase,
     Amount as [Fase $(_letter)] 
FROM
    [$(vL.ImportPath)\Gorterzelf7.xlsx]
     (ooxml, embedded labels, table is Blad1);

next _letter
gorterzelf7
Partner - Creator
Partner - Creator
Author

Thank you so much Vegar this should do the trick:-)