Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Does anyone know how to get the value of a max column then save this into a LET variable?

Hi Community, 

 

I would like to get a value from a max FileTime/Date, then save this value into a LET variable which I will use as column for another table. 

Example

Load * Inline [
Week, FileTime
Week 1, 1-1-2019
Week 2, 2-1-2019
Week 3, 3-1-2019
]

The max value for this table should be Week 3 as the max FileTime(Date) is 3-1-2019..

I want then to save Week 3 into a  LET variable...

Load 
$('Here variable '), 
Testfield
Resident Test.

 

Do you guys have any idea? 


Thanks in advance! 

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Table1:
Load Week, Date(Date#(FileTime,'D-M-YYYY'),'D-M-YYYY') as FileTime Inline [
Week, FileTime
Week 1, 1-1-2019
Week 2, 2-1-2019
Week 3, 3-1-2019
];

Table2:
LOAD FirstSortedValue(Week, -FileTime) as MaxWeek RESIDENT Table1;

LET vMaxWeek = Peek('MaxWeek',0,'Table2');


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Table1:
Load Week, Date(Date#(FileTime,'D-M-YYYY'),'D-M-YYYY') as FileTime Inline [
Week, FileTime
Week 1, 1-1-2019
Week 2, 2-1-2019
Week 3, 3-1-2019
];

Table2:
LOAD FirstSortedValue(Week, -FileTime) as MaxWeek RESIDENT Table1;

LET vMaxWeek = Peek('MaxWeek',0,'Table2');


talk is cheap, supply exceeds demand

View solution in original post

Highlighted
Creator II
Creator II

Thanks!