Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot data problem

Hi, I hope to be able ti clear up my issue. I have the following data

Dateregistration, Salesid,  Articlecode, Salesamount

Since I have multiple salesamount on the same Dateragistration with a different salesid I have done as follows:

sum (aggr(sum (Salesamount),Salesid)) with Articlecode as dimension.

My problem is that both my pivot or plain table give me the right Salesmount value only when I select the single Articlecode field .But I would like to view the full list on my table , ordering it by Amount for example. If I do not select any Articlecode the values are wrong as if they are picked up as "distinct"

Thanks to whom has time to give me a tip

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If you have ArticleCode as a dimension in your table, you will need to include it in the Aggr expression as well. Something like

Sum (aggr(sum (Salesamount),Salesid, Articlecode))

But I am not convinced that you need the aggr. The above expression should return the same results as

Sum(Salesamount)

Hope that helps

Jonathan

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

View solution in original post

4 Replies
sujeetsingh
Master III
Master III

post a sample  plz

Not applicable
Author

OK thanks, I attach a pdf with the example

qlikexample.jpg

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If you have ArticleCode as a dimension in your table, you will need to include it in the Aggr expression as well. Something like

Sum (aggr(sum (Salesamount),Salesid, Articlecode))

But I am not convinced that you need the aggr. The above expression should return the same results as

Sum(Salesamount)

Hope that helps

Jonathan

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

Thanks Jonathan, it seems to work fine with the Article included in the expression.