Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

wayneantinore-a
Contributor

Set analysis not ignoring selections

Hi, I'm running into an issue with set analysis that I'm not quite understanding.  I have a Sense application that has several sheets, on the first one I want to display several KPIs that should not change when other selections are made.  In the expression below I'm counting orders for the Chemistry Department that have a week starting value one week prior to the maximum week. 

Expression

Count({1<Department_Name = {'CHEMISTRY'},WeekStart = {"$(=Date(Max(WeekStart)-7,'M/D/YYYY hh:mm:ss TT'))"}>}[Order#])

It works fine if no selections are made but if someone selects a WeekStart value then the expression is calculating the prior week from that value.  I'm sure there is something I'm not quite understanding in the dollar sign expansion that is happening but I thought that having "{1" at the beginning would ignore all selections.

I also tried doing this with a variable but achieved the same result.  That one I sort of understand because I believe the variable is being evaluated at the time of the expansion.  Based on some other posts I tried putting an "=" in front to create the value first but although it lets me save the variable it evaluates to nothing.

Variable Definition:

Date(max(WeekStart)-7, 'M/D/YYYY hh:mm:ss TT')

Expression:

Count({1<Department_Name = {'CHEMISTRY'},WeekStart = {"$(=$(vPriorWeek))"}>}[Order#])

Thanks in advance for any help.

1 Solution

Accepted Solutions

Re: Set analysis not ignoring selections

Try this

Count({1<Department_Name = {'CHEMISTRY'},WeekStart = {"$(=Date(Max({1} WeekStart)-7,'M/D/YYYY hh:mm:ss TT'))"}>}[Order#])

2 Replies

Re: Set analysis not ignoring selections

Try this

Count({1<Department_Name = {'CHEMISTRY'},WeekStart = {"$(=Date(Max({1} WeekStart)-7,'M/D/YYYY hh:mm:ss TT'))"}>}[Order#])

wayneantinore-a
Contributor

Re: Set analysis not ignoring selections

Thanks Sunny!  That was it, I just couldn't figure out where that second ignore went.  Also got the variable to work with the following:  Date(max({1}WeekStart)-7, 'M/D/YYYY hh:mm:ss TT')

Thanks Again!

Community Browser