Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for Data Integration and Data Analytics gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Set Analysis AND/OR condition

Please help me on to fix this set Analysis script, type field not working when I use '+'

=Count({<type={'doc'},date={""} >+<date={">$(=Date(Today()))"}>} asset)

Type= doc

Date= Null or  >Today()

1 Solution

Accepted Solutions
Highlighted

Re: Set Analysis AND/OR condition

Something like this

If((type = 'doc' or (type = 'lib' and not folder like '%/drive/%')) and (Len(Trim(date)) = 0 or date > Today()), 1, 0) as Flag2

and then this:

Count({<Flag = {1}>} asset)

View solution in original post

7 Replies
MVP
MVP

Re: Set Analysis AND/OR condition

May be create a backend flag

IF(Len(Trim(Date))=0,1) as null_Date

and use as below

=COUNT({<Type = {'Doc'}>*(<null_Date = {1}>+<Date = {">=$(=Date(Today()))"}>)}Asset)


Note that Type, Doc, Date, Asset all are case sensitive.

Highlighted
Master III
Master III

Re: Set Analysis AND/OR condition

May be try

Count(

{

<type={'doc'},date={"=Len(Trim(date))=0"} >+

<type={'doc'},date={">$(=Date(Today()))"}>

} asset)

Highlighted

Re: Set Analysis AND/OR condition

Extend this further may be like this by creating a new field like this

Date(If(Len(Trim(Date)) = 0, AddYears(Today(), 1), Date)) as NewDate

and then this

=Count{<Type = {'Doc'}, NewDate = {">$(=Date(Today()))"}>} Asset)

Highlighted
Creator II
Creator II

Re: Set Analysis AND/OR condition

Thanks, can some one help with multiple operator using Set Analysis

=Count(type='doc' or (type='lib' and folder not like '%/drive/%'))

and (date='' or date>Today) asset)

Highlighted

Re: Set Analysis AND/OR condition

Once again, why can't you just create flags in the script? unless you have a specific reason to do this on the front end, I would suggest to create flags in the script to do this

Highlighted

Re: Set Analysis AND/OR condition

Something like this

If((type = 'doc' or (type = 'lib' and not folder like '%/drive/%')) and (Len(Trim(date)) = 0 or date > Today()), 1, 0) as Flag2

and then this:

Count({<Flag = {1}>} asset)

View solution in original post

Highlighted
Creator II
Creator II

Re: Set Analysis AND/OR condition

Perfect Thanks