6 Replies Latest reply: Mar 26, 2014 10:46 AM by Jonathan Dienst

set analysis problem

Hi qlikview experts,

I'm using a pivot table with two dimensions custumers and years for statistics as shown in the attached picture  ,I got to have the differnce between the year and the previous year in money and quantity , and im using this expression:for diff an-1 ..

(sum({<[Ecriture_Article. Type]={1}>}[Ecriture_Article. Sales Amount (Actual)]+[Ecriture_Article. Sales Amount (Expected)])

-sum({<[Ecriture_Article. Type]={1},[Année]={"\$(= &Année) "}-{1}>}[Ecriture_Article. Sales Amount (Actual)]+[Ecriture_Article. Sales Amount (Expected)]))

but it gives me 0 as result

• Re: set analysis problem

Hi

Your second sum statement is unclear:

• Is &Année a field name or variable?
• What is the purpose of the {< .... {1}>}? I think this is causing QV to ignore the Année field selection, so the two sum statements evaluate to the same value.
• Do you mean [Année]={"\$(= &Année - 1)"}?

HTH

Jonathan

• Re: set analysis problem

Hi jonathan ,

Année is a variable that takes the year of the field date and for the third remark, yes that's what i ment  i tried it and it gaved me 0 .

regards.

;

• Re: set analysis problem

Try each Sum() expression on their own. Are they both returning zero, or are they returning the same value?

• Re: set analysis problem

Oh, and that syntax (...-{1}) was incorrect. My suggestion is valid syntax as far as I can see.

• Re: set analysis problem

Mr Jonathan,

the first sum is correct but not the second

regards

• Re: set analysis problem

You can explore the effect of the second expression by seeing how the first expression.reacts when you make selections in Année (or other fields).

A set expression is basically a selection that takes place inside an expression, so you can see the effect of various selections and what you need to do to get the correct selections. Then you can write the set expression to mimic the manual selections.

If you need more help, I suggest that you upload a sample qvw file that illustrates the problem.