Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlik_Enthu
Creator II
Creator II

QlikSense: Avoiding "if" in an KPI`s expression

Hi All,

I am trying to convert the if statements in a table (same expression for 10columns). But, owing to the coding standards we follow, we adhere to restricting data while loading in the scripts. I am trying to convert the following expression in the script. 

If(Event_Type = '01', Event_Timestamp,'Not Received')

Kindly suggest how to convert this into a code in the data load editor.

 

Thanks in advance!

Regards,

Sai

 

Labels (1)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can use this if() expression as-is in the data load editor. Just add "as fieldname". 

If(Event_Type = '01', Event_Timestamp,'Not Received') as EventTime

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

3 Replies
QFabian
Specialist III
Specialist III

hi, there is a function called 'applymap', and is very usefull to do that convertions.

It works similar to VLOOKUP function from excel

here a couple of offical help about it :

https://help.qlik.com/en-US/sense/September2020/Subsystems/Hub/Content/Sense_Hub/Scripting/MappingFu...

 

https://help.qlik.com/en-US/sense/September2020/Subsystems/Hub/Content/Sense_Hub/Scripting/use-mappi...

 

QFabian
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can use this if() expression as-is in the data load editor. Just add "as fieldname". 

If(Event_Type = '01', Event_Timestamp,'Not Received') as EventTime

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Qlik_Enthu
Creator II
Creator II
Author

Hi @QFabian  thanks much! i tried with the applymap but it was quite difficult to achieve what i wanted. hence went for an alternative approach recommended by @rwunderlich 

 

Thanks both of you for your time and efforts!

 

Warm regards,

Sai