Qlik Community

QlikView Security & Governance

Discussion Board for collaboration on QlikView Security and Governance.

Highlighted
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.

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

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.

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

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

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

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.

;

MVP
MVP

Re: set analysis problem

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
MVP
MVP

Re: set analysis problem

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

Re: set analysis problem

Mr Jonathan,

the first sum is correct but not the second

regards

MVP
MVP

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.

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