Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Pivot table avg

Hi,

using a pivot table I have this situation:

CatturaPivot.JPG

so I have total for both columns: I wouldn't have total for the second one but the average of the percentage.

Can I do it? How?

Thank you!

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

you need to change expression from sum to avg

View solution in original post

12 Replies
Not applicable
Author

try this:

if(rowno()=0, expressionyyy, expressionxxx)

Anonymous
Not applicable
Author

Pari Pari ha scritto:

try this:

if(rowno()=0, expressionyyy, expressionxxx)

I tried

     if(rowno()=0, avg(VEN_PERC_SCONTO2)/100, sum(VEN_PERC_SCONTO2)/100)

but doesn't work...

Not applicable
Author

you can try range avg function

it will be easier if you post a small sample file:)

Anonymous
Not applicable
Author

Thank you Pari Pari, the qvw is attached below.

Not applicable
Author

can you explain why

if(rowno()=0, avg(VEN_PERC_SCONTO2)/100, sum(VEN_PERC_SCONTO2)/100)

doesn't work? IMO works fine (see att qvw file)

Not applicable
Author

YOU must be use for modify a total the function dimensionality().

Bye marchetto

Anonymous
Not applicable
Author

Pari Pari ha scritto:

can you explain why

if(rowno()=0, avg(VEN_PERC_SCONTO2)/100, sum(VEN_PERC_SCONTO2)/100)

doesn't work? IMO works fine (see att qvw file)

It doesn't work fine... (5+5+10)/3=6,67, not 5 😉

CatturaPivot2.JPG

Anonymous
Not applicable
Author

Thank you Marchetto, I also tried to use dimensionality(), but I'm not able to make it work.

Any suggestion?

Not applicable
Author

take a look at this....

avg.PNG

let's start from the beginning:)

what you want to achieve in this selection (presented on attached screen)?