Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

Sql to expression

Hi all,

This has to be achived in the straight table expresion

(CASE WHEN ((table1.lastname IS NOT NULL) OR (table1.firstname IS NOT NULL)) THEN ISNULL(table1.lastname ,'') + ', ' +

ISNULL(table1.firstname ,'') ELSE table2.namemodify by END) AS modifiedname,

how to achive this in the qlikiew straight table expression

6 Replies
vishsaggi
Champion III
Champion III

Try this may be:

= IF( ISNULL(lastname) <> -1 OR ISNULL(firstname) <> -1, lastname & ', ' & firstname, namemodifyby)

manoranjan_d
Specialist
Specialist
Author

-1 why this has been defined in the if loop wht is purpose can explain me

manoranjan_d
Specialist
Specialist
Author

actually in the when condition sql we had given not null and for the condition we given is null, but in the if loop there is only is null

vishsaggi
Champion III
Champion III

Isnull in QV returns -1 if there are any Nulls.

From Ref Guide help:

IsNull(expr )

Returns -1 (true) if expr returns NULL, otherwise 0 (false).

Quite did not get you what exactly you mean by below:

"actually in the when condition sql we had given not null and for the condition we given is null, but in the if loop there is only is null"

manoranjan_d
Specialist
Specialist
Author

in sql

when is not null(firstname) or is not null(lastname)  then take the isnull(firstname) concatenate with isnull(lastname) else  take namemodify  by


this is meeting in the


qlikview if expression?

vishsaggi
Champion III
Champion III

Ok try this?

= IF( ISNULL(lastname) <> -1 OR ISNULL(firstname) <> -1, 

        Alt(lastname, '')  & ', ' & Alt(firstname, ''), namemodifyby

      )