Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am loading some test data into Qlikview and I need to make a comparison of fields (in practice a lot more fields will have to be compared) and write the outcome in a new field. I would like the outcome to be permanently attached to the base table if possible. So far I cannot get the correct syntax to use the IF statement within the LOAD... FROM section.
Can I write values on a new field on the base table after the load? (I think no)
If yes any examples please.
If No, what am I looking for (resident?)?
Example of the code so far:
SimplestData:
LOAD [ID], // Just a letter
[ColumnOne], // Just an integer number
[ColumnTwo] // Another integer number.
FROM
FTEDates.xlsx
(ooxml, embedded labels, table is Simplest);
// For now assigning result to a variable. How can I write it to base table or another table?
IF ColumnOne > ColumnTwo THEN
Let vResult = 'Greater';
ELSEIF ColumnOne < ColumnTwo THEN
Let vResult = 'Smaller';
//and so on with other comparisons.
ENDIF
Thank you
Charles
Hi,
Try like this way
SimplestData:
LOAD [ID], // Just a letter
[ColumnOne], // Just an integer number
[ColumnTwo], // Another integer number.
if([ColumnOne]>[ColumnTwo],'Greater','Smaller') as Compared_fields
FROM
FTEDates.xlsx
(ooxml, embedded labels, table is Simplest);
If you want newly created field which is not available in original field then
go for Resident table.
Regards
Thank you. I have seen the IF statement you gave me above in various examples, but I have been unable to find any documentation for it. At least now I got a starting point.
Hi,
go to Help menu write if
You will get the syntax and example
Regards
Thank you again ... I found the syntax under functions on the script editor.