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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
shanemichelon
Partner - Creator II
Partner - Creator II

Set analysis / Selections in Qlik Sense

Hi Experts!

I have a complex dimension expression that I am using for selection purposes.  It only references one field (postingDate):

=if(postingDate=Today(1),
 Dual(
     '*Today ' & Date(postingDate,'WWW d MMM yyyy'),
        postingDate
        ),
    Date(postingDate,'WWW d MMM yyyy')
    )

When a user selects a date, the selection shows the full expression as the title of the selection. 

Posting Date selection 1.png

This doesn't really matter, but the problem is that I also have a month to date expression like this:

sum({$ <CalendarYear, Month, postingDate={">=$(=MonthStart(Min(postingDate)))<=$(=Max(postingDate))"}>} lcAmount)

This works fine if you select from the actual posting date field, but does not work if you select the complex table selection.

 

Any ideas?  I want to keep the table for selection because it highlights weekends and colours alternate weeks:Posting Date selection.png

 

 

 

 

Labels (1)
1 Solution

Accepted Solutions
juraj_misina
Partner Ambassador Affiliate
Partner Ambassador Affiliate

Hi,

you need to use aggr() in your calculated dimension expression to scope the selection. See details in this great post by @rwunderlich:

https://qlikviewcookbook.com/2016/01/scoping-selections-with-aggr/

Hope this helps.

Juraj

View solution in original post

4 Replies
juraj_misina
Partner Ambassador Affiliate
Partner Ambassador Affiliate

Hi,

you need to use aggr() in your calculated dimension expression to scope the selection. See details in this great post by @rwunderlich:

https://qlikviewcookbook.com/2016/01/scoping-selections-with-aggr/

Hope this helps.

Juraj

Anil_Babu_Samineni

Is your MTD formula is correct?

sum({$ <CalendarYear, Month, postingDate={">=$(=MonthStart(Min(postingDate)))<=$(=Max(postingDate))"}>} lcAmount)

For me, This should be like

sum({$ <CalendarYear, Month, postingDate={">=$(=MonthStart(Max(postingDate)))<=$(=Max(postingDate))"}>} lcAmount)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
shanemichelon
Partner - Creator II
Partner - Creator II
Author

Thanks  I'll try that!

shanemichelon
Partner - Creator II
Partner - Creator II
Author

Good Pickup. Thanks!