Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to record values

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

4 Replies
PrashantSangle

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

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

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.

PrashantSangle

Hi,

go to Help menu write if

You will get the syntax and example

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Thank you again ... I found the syntax under functions on the script editor.