Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Include numbers but exclude during calc

I have a number range 1-1000 which I successfully import.

No 15,25,50,75 and 90, I need to exclude from all calculations but later on a seperate sheet display my analysis.

How do I go about doing this.

My statement reads as follows -

If([number] >=1 and [number] <= 10000, 'Valid','Not defined') as d_type

Tags (1)
4 Replies
giakoum
Honored Contributor II

Re: Include numbers but exclude during calc

create a flag for these numbers as a new field and use it in set analysis

if([number]=15 or [number]=25 or [number]=50 or [number]=75 or [number]=90, 1, 0) as CalculateFlag

anbu1984
Honored Contributor III

Re: Include numbers but exclude during calc

If( ([number] >=1 and [number] <= 10000) And Not([number]=15 or [number]=25 or [number]=50 or [number]=75 or [number]=90), 'Valid','Not defined') as d_type

cabhijit
Valued Contributor

Re: Include numbers but exclude during calc

If(

     ([number]>=1 and [number]<=10000)

     and not Match([number],15,25,50,75,90),

     'Valid','Not defined'

) as d_type

MVP
MVP

Re: Include numbers but exclude during calc

Hi

I am assuming from your post that you want to load these numbers, but exclude them from your calculation(s). Thne use the following set expression to exclude them:

     <number -= {15,25,50,75,90}>

Use it in an expression like this for example:

     Sum({<number -= {15,25,50,75,90}>} amount)

The -= will flag as a syntax error in the expression editor. This is a bug in the syntax check, so just ignore this warning.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Community Browser