Discussion Board for collaboration on QlikView Scripting.
i need to make a flag that determinates if a line is the last one for a item and i would like to do it in load script.
The LAST_VERSION_FLAG is the field i need to create. Any advice appreciated.
Go to Solution.
LOAD Folllwoup_no, max(version) as max from Table group by Folllwoup_no;
LET vflag = peek('tmp', 0, 'max');
if(version = $(vFlag), 'Yes,' No') as flag_version
drop table Original_table;
Here is a solution. It is not the only one, you can use applymap, or use 2 tables with join
up to you
I don't really undrstand the question as it seems you got already the answer.
Load your table and get the Version WHERE Flag='Yes'
LET vFlag = peek('table_name', 0, 'version');
Display $(vFlag) in a text object for example
Sorry if i was not clear enough ^^
My Actual situation is the following:
and my desired output is the following:
So LAST_VERSION_FLAG should be calculated in script.
Hope i made it clear now.
Try like this
LOAD * Inline
Load FOLLOWUP_NO, Max(VERSION) AS Flag Resident Test1 Group by FOLLOWUP_NO;
Load FOLLOWUP_NO, VERSION, if(Flag = VERSION, 1, 0) AS LAST_VERSION_FLAG Resident Test1;
DROP Table Test1;
Thank you both,
1 year and a half of QV develpment and i never used a Group By in the Load Script. Epic ^^