Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
viveksingh
Creator III
Creator III

Qliksense- replace for If statement

Hi Experts,

I have few IF STATEMENTS in my script and want to remove them due to performance issue can you help me on this.

Below is sample one,

IF(GROUP_NAME='ABC',LOCAL_AMOUNT,0) as ACCOUNT_1

IF(match(GROUP_NAME,'CASH','INV','PAID EXP'),LOCAL_AMOUNT,0) AS CURRENT_AMOUNT

In above two IF STATEMENTS, GROUP_NAME is coming from Table1 and LOCAL_AMOUNT is coming from Table2.

so, I joined the two tables (Table1 and Table2) to write if statement.

Can you  in improving the performance by replacing the IF STATEMENTS with any other.

Thanks,

Vivek

1 Reply
Not applicable

Hi Vivek,

          You can use Apply Map() Function.. or You can use crosstable() function to join 2 tables...

Apply Map(): https://help.qlik.com/en-US/sense/3.2/Subsystems/Hub/Content/Scripting/MappingFunctions/ApplyMap.htm

Crosstable(): https://help.qlik.com/en-US/sense/3.0/Subsystems/Hub/Content/LoadData/work-with-cross-tables.htm

You can take help from above 2 links.