7 Replies Latest reply: Nov 13, 2012 3:41 AM by Tim Hop

# Expression Query

Hi everyone.

i am struggling with writing an expression for the following.

I want to a count of all the distinct [PupilID] which meet the following criteria.

they must have a [APSScore] of more than 1. the [APSScore] is worked out by deducting [Chrono]={7} from [Chrono]={6} and by only looking at [LevelScore]='Score'.

Does this make sense?

Can anyone help please?

thanks

• ###### Re: Expression Query

Hi,

You have to make expression like

Count(if( [APSScore] >1 and  [Chrono] = 7 and [Chrono] = 6 and [LevelScore]='Score' , [PupilID]))

what do you mean [Chrono]={7} from [Chrono]={6}

HTH

Regards,

Anand

• ###### Re: Expression Query

Hi Chrono is a field.

for example...

Student A

Chrono 7 = 25

Chrono 6 = 20

Chrono 7-Chrono 6 = 5

So as this student has a score greater than 1 i would want he/she counted. if she had a score of 0 or below then i would not want her counted.

So i need the above calculation to be in the expression

Hope that helps.

The expression you gave doesnt work as the score has not been worked out

Thanks

• ###### Re: Expression Query

Hi,

So write some thing like this

Count(if( [APSScore] >1 and  [Chrono7] - [Chrono6] > 0 and [LevelScore]='Score' ,[PupilID]))

Regards,

Anand

• ###### Re: Expression Query

Hi thanks for replying,

Chrono is the field name, the 6 and 7 are the field values, so how would i add that to the expression. as i cant use [Chrono6] etc as chrono6 isnt a field name.

something like chrono ={6}?

• ###### Re: Expression Query

or would it need to be set analyisis?

As you can see, i am new to qlikview!

• ###### Re: Expression Query

Can anyone help with this?

I think i need to do something like...

if Chrono 7 - Chrono 6 >0 and LevelScore='Score' then count PupilID

I also need it to ignore selections in the field Year/Term.

but i don't know how to write this is an expression.

Many thanks

• ###### Re: Expression Query

Does anyone have any ideas?