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: 
sivakrishna
Contributor II
Contributor II

To know recent month sales

Hi, If i have  data like this and i would like to load recent month 'salary' for each employee and load all tables . please let me know answer by considering below data

emp, date, salary
ramu,1/1/2017,100
ramu,2/1/2017,200
siva,1/1/2017,400
siva,2/1/2017,200
siva,6/1/2017,400

 

1 Solution

Accepted Solutions
IamAlbinAntony
Creator
Creator

Try this,
test1:
Load * Inline [
emp, date, salary
ramu,1/1/2017,100
ramu,2/1/2017,200
siva,1/1/2017,400
siva,2/1/2017,200
siva,6/1/2017,400
];
test2:
NoConcatenate
Load emp&max(Date(date,'mm/dd/yyyy')) as conc
resident test1
group by emp;
left Join
load *,emp&Date(date,'mm/dd/yyyy') as conc Resident test1;
drop Table test1;
drop Field conc;

View solution in original post

2 Replies
IamAlbinAntony
Creator
Creator

Try this,
test1:
Load * Inline [
emp, date, salary
ramu,1/1/2017,100
ramu,2/1/2017,200
siva,1/1/2017,400
siva,2/1/2017,200
siva,6/1/2017,400
];
test2:
NoConcatenate
Load emp&max(Date(date,'mm/dd/yyyy')) as conc
resident test1
group by emp;
left Join
load *,emp&Date(date,'mm/dd/yyyy') as conc Resident test1;
drop Table test1;
drop Field conc;
Channa
Specialist III
Specialist III


=Sum({$<[date]={">=$(=MonthStart(Today(),-2))<$(=monthend(Today(),0))"}>}Sales)

 

 

Channa