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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help on Date Range for Set Analysis

Hello Qlikview Community

I am trying to calculate the count of orders for a specific order type (ZPM3) within a specific date range.

=Count({<Order.Type={'ZPM3'},Calendar.Date={">=2015-01-01<=RCAOrderDate"}>}[Order.Number of orders])

8 Replies
sunny_talwar

What is RCAOrderDate here? a single value selected or single value possible?

Qrishna
Master
Master

=Count({<Order.Type={'ZPM3'},Calendar.Date={">= $(=date(MakeDate(2015,01,01),'YYYY-MM-DD') ) <=RCAOrderDate"}>}[Order.Number of orders])


make sure RCAOrderDate is a value (not a field) and in the same format as Calendar.Date



Anonymous
Not applicable
Author

Good Morning Krishna,

I believe that is where I am having a problem.

I have RCAOrderDate as a field in my expressions, it is in the same format as Calendar.Date.

QVSnip.JPG

sunny_talwar

In that case, I don't think you will be able to use set analysis here... I suggest using Aggr with an if statement to get this resolved... or handle this in the script to create a flag and then use the flag in the set analysis....

Qrishna
Master
Master

try this in the expression:

= if( Calendar.Date <=RCAOrderDate ,

     Count({<Order.Type={'ZPM3'},Calendar.Date={">= $(=date(MakeDate(2015,01,01),'YYYY-MM-DD') ) "}>}       [Order.Number of orders]), 'Put Your ELSE statment'

)



if RCAOrderDate is calculated measure , then do this -


= if( Calendar.Date <=Column(#) ,

     Count({<Order.Type={'ZPM3'},Calendar.Date={">= $(=date(MakeDate(2015,01,01),'YYYY-MM-DD') ) "}>}       [Order.Number of orders]), 'Put Your ELSE statment'

)


where # is the column number of calculated measure RCAOrderDate



sasiparupudi1
Master III
Master III

please share the expression RCAOrderDate

Anonymous
Not applicable
Author

=only({$<[Order.Type]={'ZPM3'},[Order.Maint Act Type]={'RCA'}>}[Order.Start Date])

sasiparupudi1
Master III
Master III

May be try

Count({<Order.Type={'ZPM3'},Calendar.Date={">=2015-01-01<=$(=only({$<[Order.Type]={'ZPM3'},[Order.Maint Act Type]={'RCA'}>}[Order.Start Date]))"}>}[Order.Number of orders])


if it does not work , try breaking the expressions and see if you get theresults


Count({<Order.Type={'ZPM3'},Calendar.Date={">=2015-01-01"}>}[Order.Number of orders])


Count({<Order.Type={'ZPM3'},Calendar.Date={"<=$(=only({$<[Order.Type]={'ZPM3'},[Order.Maint Act Type]={'RCA'}>}[Order.Start Date]))"}>}[Order.Number of orders])


if they dont work, pl share a sample