Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
nithyalakshmip
Partner - Contributor II
Partner - Contributor II

Generate missing division and segment for each date

Hi Can you plz help in resolving diz 

Labels (1)
1 Solution

Accepted Solutions
JMAROUF
Creator II
Creator II

Hello @nithyalakshmip  try this:

Input:
LOAD * INLINE [
Date,Division,Segment,Value
01/01/2016,Gents,Shirt,50
01/01/2016,Ladies,Saree,40
01/01/2016,Kids,Traditional,200
01/01/2016,General,Bedsheet,200000
02/01/2016,Gents,Shirt,100
02/01/2016,Ladies,Saree,80
02/01/2016,Kids,Traditional,100
02/01/2016,General,Bedsheet,100000
03/01/2016,Gents,Shirt,50
03/01/2016,Ladies,Saree,40
03/01/2016,Kids,Traditional,200
04/01/2016,Gents,Shirt,50
04/01/2016,Ladies,Saree,40
04/01/2016,General,Bedsheet,200000
05/01/2016,Gents,Shirt,50
05/01/2016,Kids,Traditional,200
05/01/2016,General,Bedsheet,200000
06/01/2016,Ladies,Saree,40
06/01/2016,Kids,Traditional,200
06/01/2016,General,Bedsheet,200000
];


Output:
NoConcatenate
LOAD * INLINE [
Date,Division,Segment,Value
01/01/2016,Gents,Shirt,50
01/01/2016,Ladies,Saree,40
01/01/2016,Kids,Traditional,200
01/01/2016,General,Bedsheet,200000
02/01/2016,Gents,Shirt,100
02/01/2016,Ladies,Saree,80
02/01/2016,Kids,Traditional,100
02/01/2016,General,Bedsheet,100000
03/01/2016,Gents,Shirt,50
03/01/2016,Ladies,Saree,40
03/01/2016,Kids,Traditional,200
03/01/2016,General,Bedsheet,100000
];

result_tmp:
NoConcatenate
load * resident Input;
Concatenate
load * resident Output;

result:
NoConcatenate
load distinct * resident result_tmp order by Date asc ;

drop tables Input,Output,result_tmp;

View solution in original post

4 Replies
Patricia_Silva
Specialist II
Specialist II

Hello @nithyalakshmip could you kindly please specify a little bit more about what you are trying to achieve? I have checked the excel file but it is not clear to me. Thanks 😊

Help users find answers! Don't forget to mark a correct resolution 🙂
nithyalakshmip
Partner - Contributor II
Partner - Contributor II
Author

Hi,

In output sheet yellow colored is missing row from the Input sheet. Like wise need to compare the input and output sheet, and display the result

JMAROUF
Creator II
Creator II

Hello @nithyalakshmip  try this:

Input:
LOAD * INLINE [
Date,Division,Segment,Value
01/01/2016,Gents,Shirt,50
01/01/2016,Ladies,Saree,40
01/01/2016,Kids,Traditional,200
01/01/2016,General,Bedsheet,200000
02/01/2016,Gents,Shirt,100
02/01/2016,Ladies,Saree,80
02/01/2016,Kids,Traditional,100
02/01/2016,General,Bedsheet,100000
03/01/2016,Gents,Shirt,50
03/01/2016,Ladies,Saree,40
03/01/2016,Kids,Traditional,200
04/01/2016,Gents,Shirt,50
04/01/2016,Ladies,Saree,40
04/01/2016,General,Bedsheet,200000
05/01/2016,Gents,Shirt,50
05/01/2016,Kids,Traditional,200
05/01/2016,General,Bedsheet,200000
06/01/2016,Ladies,Saree,40
06/01/2016,Kids,Traditional,200
06/01/2016,General,Bedsheet,200000
];


Output:
NoConcatenate
LOAD * INLINE [
Date,Division,Segment,Value
01/01/2016,Gents,Shirt,50
01/01/2016,Ladies,Saree,40
01/01/2016,Kids,Traditional,200
01/01/2016,General,Bedsheet,200000
02/01/2016,Gents,Shirt,100
02/01/2016,Ladies,Saree,80
02/01/2016,Kids,Traditional,100
02/01/2016,General,Bedsheet,100000
03/01/2016,Gents,Shirt,50
03/01/2016,Ladies,Saree,40
03/01/2016,Kids,Traditional,200
03/01/2016,General,Bedsheet,100000
];

result_tmp:
NoConcatenate
load * resident Input;
Concatenate
load * resident Output;

result:
NoConcatenate
load distinct * resident result_tmp order by Date asc ;

drop tables Input,Output,result_tmp;

nithyalakshmip
Partner - Contributor II
Partner - Contributor II
Author

Hello @JMAROUF 

 

Thank you. It works.