Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
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 (2)
1 Solution

Accepted Solutions
rwunderlich
Luminary Alumni
Luminary Alumni

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 II
Specialist II

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
Luminary Alumni
Luminary Alumni

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

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