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: 
shamitshah
Partner - Creator
Partner - Creator

Difference between two variables in set analysis

Hi,

I have the following expression which is not giving the right result (trying to find number of stores with no adjustments):

=vNoOfStores-
Count(Distinct{<Department={"=$(vArticleDim)"}>}[%STORE_ID])

 

where vNoOfStores =Count({1}Distinct(%STORE_ID))   (this expression gives me a result which is the total number of stores)

The expression Count(Distinct{<Department={"=$(vArticleDim)"}>}[%STORE_ID]) on its own gives me no result which is strange given that the first expression gives me a result.

Any ideas?

Thanks

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try

=$(vNoOfStores)-Count(Distinct{<Department={"=$(vArticleDim)"}>}[%STORE_ID])


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try

=$(vNoOfStores)-Count(Distinct{<Department={"=$(vArticleDim)"}>}[%STORE_ID])


talk is cheap, supply exceeds demand
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Is vArticleDim an article value or a field name? If vArticleDim contains a value you should not use  = within the quotes.  Further, unless you are using wildcards in the search you should use single rather than double quotes. 

Count(Distinct{<Department={'$(vArticleDim)'}>}[%STORE_ID])

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

shamitshah
Partner - Creator
Partner - Creator
Author

It is actually a  dynamic filter (='Department|Category|"Sub-Category"|ARTICLE_D')

shamitshah
Partner - Creator
Partner - Creator
Author

Thanks Gysbert. That works.