Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read 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?

18 Replies
Not applicable
Author

But this gives me all the dates that are greater than today.  I want to restrict it to just one day i.e today.  I tried '>=' in the above expression.  It looks fine but it is filtering out all dates greater than today.  Please help me how to handle '>='

Capture.JPG

sasiparupudi1
Master III
Master III

Try

= '>' & TIMESTAMP(FLOOR(TODAY())) and '<=' & TIMESTAMP(DayEnd(TODAY()))

hth

Sasi

Not applicable
Author

The Expression looks OK but it does not work.

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

sasiparupudi1
Master III
Master III

Please try one more time

= '>=' & TIMESTAMP(FLOOR(TODAY())) & ' and  <=' & TIMESTAMP(DayEnd(TODAY()))

jonathandienst
Partner - Champion III
Partner - Champion III

Today() does not contain time information and the comparison should be on the value of the date, so all he Floor()ing and formatting is unnecessary and just confusing the issue. Something like this should work:

>=(Today()) Ans  <(Today() + 1)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi,

The expression is valid and it is even appearing correctly in 'Current Selection'; however, the data is not filtered as per the range we specify.Capture.JPG

However converting the original timestamp column to date and then using a simple equal to is working fine.  So problem solved

Thank you very much!

Not applicable
Author

That's true.  I too realized it.  Thanks!

Not applicable
Author

Hi,

Thank you very much!  This suggestion works!  I converted the timestamp to date column, so specifying a date range is not necessary now.