Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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 

thx in advance.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

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.

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

View solution in original post

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

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.

;

jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Mr Jonathan,

the first sum is correct but not the second

regards

jonathandienst
Partner - Champion III
Partner - Champion III

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.

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