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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
pallvit_01
Contributor II
Contributor II

Set Analysis

Hi,

I am having a data of 2006,2007,2008 3 years data using an expression For PYTD 

Sum({$<OrderDate = {">=$(=YearStart(AddMonths(Max(OrderDate),-12))) <=$(=AddMonths(Max(OrderDate),-12))"}>}Sales)

which is working fine and  giving me total sales of 2007 year. But when i am selecting year 2007 in my year filter. 

This is expression is giving me 0.

If I am using following expression

Sum({$<Year =, OrderDate = {">=$(=YearStart(AddMonths(Max(OrderDate),-12)))<=$(=AddMonths(Max(OrderDate),-12))"}>}Sales)

Then it is working fine for my year filter. 

May anybody tell me what is the difference in those 2 expressions & why is data coming 0 for my first expression which i mentioned.

 

Regards.

3 Replies
pradosh_thakur
Master II
Master II

 

Sum({$<Year =, OrderDate = {">=$(=YearStart(AddMonths(Max(OrderDate),-12)))<=$(=AddMonths(Max(OrderDate),-12))"}>}Sales)

The "Year= " nullify any selection made on the year so year doesn't affect your expression any more. Where as the associated value are there and your max order date is somewhere in 2007 and you get the data for 2006 with the help of " orderdate ={">=  .... "} " expression.

 

Thanks

Pradosh

 

Learning never stops.
Sue_Macaluso
Community Manager
Community Manager

Hi, Is this for QlikView or Sense? Id like to move it into the correct product forum.
Did you find a solution to your question? Mark the solution as accepted : and if you found it useful, press the like button!
pallvit_01
Contributor II
Contributor II
Author

Hi, 

I am Using same expression in both QlikSene and QlikView.

 

Best Regards.

Pallvit Pratap