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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exclusion in Set Analysis

HI All

I am currently using this set analysis for calculating Netsales in a Straight Table

SUM( AGGR((Sum({<MONTH={'$(vThismonth)'}>}NETSALE))

now i need to exclude credits, with flag 1

exclude CR = 1

how to achieve this

i tried this but result not as expected

SUM(

  AGGR(

  (

  Sum({<MONTH={'$(vThismonth),CR -={1}'}>}NETSALE))


Please Suggest

15 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

You have an extra curly bracket after the CC -={1}.

SUM(

  AGGR(

  (

  Sum({<MONTH={'$(vThismonth)'}, CC -={1}>}NETSALE)

  /

  Only({<MONTH={'$(vThismonth)'}>}WORKINGDAYS)

  )

  ,BRANCH)

Anonymous
Not applicable
Author

can you Show your complete expression

did you try the Expression?

AGGR(

  (

  Sum({<MONTH={'$(vThismonth)'}, CC -={1}}>}NETSALE)

  /

  Only({<MONTH={'$(vThismonth)'}>}WORKINGDAYS)

  )

  ,BRANCH)

if thisexpression results in 0

try the single expressions

Sum({<MONTH={'$(vThismonth)'}, CC -={1}}>}NETSALE)

and see the results

are the month Format identical?

Not applicable
Author

HI Marcus

I tried without the extra } but not showing any Values

Not applicable
Author

HI Rudolf

the Month fields are identical

when i use this below expression alone i am getting values

Anonymous
Not applicable
Author

so let's summarize

you get a value when you use Sum({<MONTH={'$(vThismonth)'}, CC -={1}}>}NETSALE)

monthfield and variable are identical,

but complete Expression Returns 0

question: does your datamodel have a Connection between BRANCH and values?

               is the resulting number large enough >0 (or is NETSALES/NrOfWorkingdays)<1 and Expression is         defined as integer?

-> can you post example qvw?

Not applicable
Author

HI Rudolf

Your expression worked, Don't know  why it didn't work initially, I recreated the Straight table and it worked

might be i missed  some thing

SUM(

  AGGR(

  (

  Sum({<MONTH={'$(vThismonth)'},CR -={1}>}NETSALE))