Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Modifier as initial filter

 Hi exprerts,

I have implemented a straight table and one of the expressions is the following 

= Sum({    < Year={$(=Year(Today())-1)},    DayofYear={"<$(=DayNumberOfYear(Today()-2))"}>} Sales)

It calculates based on the current selection ,  Last Year to Date ( LYTD)  sales. 

However when I override the current selection of the dimension DayofYear ( e.g  select a specific day of year ) the modifier overrides values of current  selection   

Is there any way to implement it ?   

In my point of view , I would like to represent a set of data where modifier works as an initial filter and then current selection overrides it . 

Thanks in advance 



Labels (3)
10 Replies

There were few issues

1) Incorrect Parenthesis within the expression... might have been my mistake

2) The field name is DayofYear, but we were using DayOfYear

3) The selection is taking place in the alternate state

Try this expression

= Sum({<Year = {$(=Year(Today())-1)}, DayofYear = {"<$(=if(GetSelectedCount(DayofYear, ',', 100000, 'Main')= 0, DayNumberOfYear(Today()-1), DayofYear))"}>} AfterOrderDiscountValue)

But remember this will only work if you directly make a selection in DayofYear field.... if you hope to make selection in other fields like day of month or day of week, then you might have change the expression based on the output you are looking to get

View solution in original post