Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis zero values if no selection is made

I'm trying to get a count of all publications, that a customer in the USA has access to, which are located in the customers state, base on a date range. If a customer is selected, then I get the results I need.  If a customer is not selected, then the result is zero.    Count({=$(=(vPivot_StartDate))<$(=date(vPivot_Date))"},[PUB USA or International]={USA},[CAM USA or International]={USA},[CAMS_State]={"=PUB_State=CAMS_State"}> } DISTINCT(pubid)) I would like to be able to see both a result for all USA customers that use in-state publications as well as the individual customer results as well.  Thanks, Jen

13 Replies
Not applicable
Author

Count({1<view_date = {">= $(=vPivot_StartDate)"}, view_date = {"< $(=vPivot_Date)"}, [CAM USA or International] = {'USA'}, [PUB USA or International] = {'USA'}, [PUB_State] = {'CAMS_State'}>}  DISTINCT pubid)

Give that a try for all customers.  Can you upload your qlikview document?  Or part of it?  If I could see your data and where you're trying to show these values maybe I'd be more help.

swuehl
MVP
MVP

Well, you could combine the set analysis with the if  clause, use something like

=sum( {<view_date={">=$(=(vPivot_StartDate))<$(=date(vPiovot_Date))"),[PUB USA or International] = {USA},[CAM USA or International]={USA} >} if(CAMS_STATE=PUB_State, Usage,0))

Anonymous
Not applicable
Author

Thank you both for your suggestions, but I'm still getting the same results. 

The only way I could upload the qlikview document would be to remove the data, because of the information within the document.  I'm not sure seeing the document without the data would help solve the issue though.

I truely appreciate the help, thank you!

swuehl
MVP
MVP

Yould could scramble some fields, e.g. personal information, ( go to Document properties -> Scrambling), but I don't want to talk you into something.