Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

matheus_silva
Contributor

Sum(Total<>)

Hi guys.

Hlep me with somethig, for example:

I have some products...
 

  Product               Segment          Amont Sales

  Heineken              Beer                10

  Budweiser             Beer                20  

  Blue Label            whisky              30

  Jack Daniels         whisky              40

If i make :

Product               Segment          Amont_Sales          Sum( Total Amont_Sales)

  Heineken              Beer                10                         100

  Budweiser             Beer                20                         100   

  Blue Label            whisky              30                         100

  Jack Daniels         whisky              40                         100


Right?


But i dont wanna TOTAL , i want TOTAL by Segment,  in the other words, the table must be like this:


Product               Segment          Amont_Sales          Sum( Total <Segmente> Amont_Sales)

  Heineken              Beer                10                         30

  Budweiser             Beer                20                         30

  Blue Label            whisky              30                         70

  Jack Daniels         whisky              40                         70



But "Sum( Total <Segmente> Amont_Sales)" not its worked in my example...


Someone knows how i do that?


Thank you.


1 Solution

Accepted Solutions

Re: Sum(Total<>)

Try this:

=Aggr(Sum(TOTAL <Segment> [Amont Sales]), Product, Segment)

4 Replies
MVP
MVP

Re: Sum(Total<>)

Create a straight table chart with two dimensions, using Product and Segment field.

Then create two expressions

=Sum(Amont_Sales)

=Sum(TOTAL<Segment> Amont_Sales)

Segment should be the field you are using as dimension.

matheus_silva
Contributor

Re: Sum(Total<>)

I got it...Really works...but to my solicitation i must have only Product as dimension...

You know another way to make this?...
I forgot to warn, but i am in qliksense..=/

If not have solution, no problem...=D

Thanks anyway...

Re: Sum(Total<>)

Try this:

=Aggr(Sum(TOTAL <Segment> [Amont Sales]), Product, Segment)

matheus_silva
Contributor

Re: Sum(Total<>)

Thank you!!!