Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

OR Logic using Button

Hi,

We are converting some Business objects reports, using a list of filters in Qlikview.  I am having a button in qlikview for each report.  The button has the list of conditions inbuilt so when a user clicks on the button, the report gets generated as per the conditions given inside the button. 

Couple of issues here:

1. Date compare.  I have this in Field

=date(TEST_EXPIRATION_DT)

I have given this in Search String

=date(now(),'MM/DD/YYYY')

but it's not working.  Basically I want to filter out records when the test_expiration_dt matches sysdate/current date

2. How to handle OR conditions.  I don't see an option for this within Button.  Do we have any other way to handle the combination of 'OR' and 'AND' conditions?

1 Solution

Accepted Solutions
dclark0699
Creator
Creator

I didn't realize there would be dates greater than today in there. I would encourage you to create a field in your data model via the script that is just the date.

FLOOR(TEST_EXPIRATION_DT) as TEST_EXPIRATION_DATE

Then use the button to select in that field instead

View solution in original post

18 Replies
dclark0699
Creator
Creator

The "Field" field of the button action is going to be looking for a an actual field in the data model. So I don't think you can put a function on the field here. I could be wrong.

Try Field = TEST_EXPIRATION_DT

Search String = NUM(TODAY())

You can remove the NUM() if TEST_EXPIRATION_DT is not a number in the data model.

Not sure what you mean by AND/OR conditions without an example. You can do advanced searches within a field that can do all kinds of extensive logic though. For example, searching in an ID column with "=FIELD_A = 'YES' OR FIELD_B = 'YES'"

Not applicable
Author

Thanks for your reply.  I tried but it does not work.  It is a date datatype so I had removed num() and still it did not work.  Please assist.

Thanks,

Sudha.

dclark0699
Creator
Creator

Would you be able to attach a sample qvw? You can scrub out any sensitive information, but it's helpful to make sure I understand exactly what you are trying to do

Not applicable
Author

Capture.JPG!It's a date datatype coming from a database table so I am not sure how to attach the qvw.  But I just did as you had demonstated.

dclark0699
Creator
Creator

Try this

=DATE(FLOOR(TODAY()))

This works in my data model where I have the date as a number =FLOOR(TODAY())

sasiparupudi1
Master III
Master III

It looks like your field is a timestamp.

Try Field = TEST_EXPIRATION_DT

Search String = Timestamp(now(),YourtimestampFormat)

hth

Sasi

Not applicable
Author

Hi,

You are right.  Though it's a date datatype, it appears like a timestamp value.  I tried what you had suggested and it does not work still.Capture.JPG

dclark0699
Creator
Creator

Ah I see the problem from that screenshot. What you are searching for there is the exact moment you click the button. But it sounds like you want any records that have occured at any point during the day, correct?

So you should be about to put in the search field

= '>' & TIMESTAMP(FLOOR(TODAY()))

This would be telling it to search for any value that occured since the beginning of the day

Not applicable
Author

Thank you so much!  This is working