Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mikef80
Contributor
Contributor

Help with 'if statement' creation within Qlik Sense

Hi All,

 

I'm very new to Qlik Sense - I've been using it for a couple of days so far.  So please bear with me!

 

I've managed to import all my data sets as I wanted to and I've managed to implement some filters to change the data that I see, such as sorting by date, sector or category.  My issue is this though - I have imported a couple of data fields (timeA and timeB) that contain duration data, recorded in seconds. I wanted to be able to create a filter that effectively says:

if(timeA + timeB > 10,"fail","pass")

I then want to be able to select either "fail","pass", neither or both with the filter control.

I'm generally happy with the structure of coding conditional statements, but I'm not very familiar with the grammar of Qlik yet so am unsure how to do this. I feel like i'm on the edge of understanding how to do this, but appear to be going around in circles, so would appreciate some input.

 

Many thanks,

 

Mike

Labels (6)
3 Replies
Janneke
Creator
Creator

Hi Mike,

You should create this filter in the script. Within your load statement you can add your formula and give it a name. After that you are able to create a filter.

Success!

Janneke. 

mikef80
Contributor
Contributor
Author

Thank you!  Unfortunately, I have no idea how to do that, so may have to wait until my colleague is back in so we can go through this together!

 

I managed to find the load statements, but that's about as far as I could get! I started typing the if statement, but there appears to be no auto-suggestion of fields that I'm trying to use, so I suspect that I'm doing something wrong!

Janneke
Creator
Creator

Hi Mike,

What you typed in the initial question seems the right formula. Might want to change the double quotes to single quotes. Have you typed in a comma to separate the fields?

Janneke.