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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
agaumet
Contributor
Contributor

Table split last period

Hi all,

I'm relatively new to Qlik sense editor and am trying to achieve the following: I have a table that contains data from client over several period. I would like to create a new table using the loading script where table1 = all data and newtable = data only for last period (month)

table1:

Client IDClient Name

Country

IndustryPeriod
001

ABC

FR

Manufacturing31/10/2020
002DEFCHCapital Market31/10/2020
003GHI

UK

Capital Market31/10/2020
004JKLUSRetail31/10/2020
005MNOINRetail31/10/2020
001

ABC

FR

Manufacturing30/11/2020
002DEFCHCapital Market30/11/2020
003GHI

UK

Capital Market30/11/2020
004JKLUSRetail30/11/2020
005MNOINRetail30/11/2020

 

newtable:

Client IDClient Name

Country

IndustryPeriod
001

ABC

FR

Manufacturing30/11/2020
002DEFCHCapital Market30/11/2020
003GHI

UK

Capital Market30/11/2020
004JKLUSRetail30/11/2020
005MNOINRetail30/11/2020

 

Any suggestions on how to achieve that ? Thanks in advance for the help !

Best,

Alex

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan

HI @agaumet 

Try like below

T:
LOAD [Client ID],
[Client Name],
Country,
Industry,
Period
FROM
[https://community.qlik.com/t5/New-to-Qlik-Sense/Table-split-last-period/td-p/1761858]
(html, codepage is 1252, embedded labels, table is @1);

Inner Join(T)
Load [Client ID], Max(Period) as Period Resident T group by [Client ID];

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
MayilVahanan

HI @agaumet 

Try like below

T:
LOAD [Client ID],
[Client Name],
Country,
Industry,
Period
FROM
[https://community.qlik.com/t5/New-to-Qlik-Sense/Table-split-last-period/td-p/1761858]
(html, codepage is 1252, embedded labels, table is @1);

Inner Join(T)
Load [Client ID], Max(Period) as Period Resident T group by [Client ID];

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
agaumet
Contributor
Contributor
Author

Hi @MayilVahanan ,

Works like a charm thanks ! however there's something I did not anticipate. Some client ID are present in prior period (i.e 31/10/2020) and not the last (i.e30/11/2020). I would like to keep only the one for the last period.

Any ideas how to achieve that ?

Many thanks,

Alex

MayilVahanan

Hi @agaumet 

In that case, inner join with only the Max(Date) . Hope it helps.

Inner Join(T)
Load Max(Period) as Period Resident T;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.