# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Highlighted
New Contributor III

## Problem with p() in straight table

Hi there !

I hope you can help me.

I habe a straight table with two dimensions (Material_Cat1, Material_Cat2).

I want to calculate the sum of volume (=space) of all possible delivery notes for Material_Cat2, but I want the total volume of those delivery notes regardless Material_Cat2...

I tried this Expression to get what I want and it works well for Material_Cat2=CE Internet Radio

=sum({<Material_Cat1=, Material_Cat2=, %Deliverynote=P({1<Material_Cat2={"CE Internet Radio"}>} %Deliverynote) >} TOTAL Volumen)

Of Course it does't work for the other rows in the table.

Have you an Idea how I could fix and replace  ={"CE Internet Radio"} with something which selects  the right Material_Cat2 for each row ?

Thank you very much in advance!

Labels (3)

7 Replies
MVP & Luminary

## Re: Problem with p() in straight table

Try: =sum({<Material_Cat1=, Material_Cat2=>} TOTAL <Material_Cat2> Volumen)

talk is cheap, supply exceeds demand
New Contributor III

## Re: Problem with p() in straight table

Hi Gysbert! Thanks for your suggestion. Unfortunately it doesn‘t work...
The results in the Chart are the same as if I put
sum(Volumen).

What I‘m basically doing manually in my app to get the correct value in a Text Box is:
1) Text Box with expression: sum(Volumen)
2) select from a list Box one Mateial_Category2, for example „CE IT“
3) select from a list Box ALL POSSIBLE DeliveryNotes
4) CANCEL SELECTION In the Material_Category2 list Box
=> Now I have the Sum of Volume
-disregarding the category
-but only for delivery notes which contained at least one article belonging to that category

My wish was to create a straight table with an expression which leads to the same result for all categories at once.

I hope I could explain... Thanks!

Honored Contributor II

## Re: Problem with p() in straight table

`=sum({<Material_Cat1=, Material_Cat2=, %Deliverynote=P({<Material_Cat2=p(Material_Cat2)>} %Deliverynote) >} Volumen)`

Try the above and check if you need the total keyword or not.

Learning never stops.
New Contributor III

## Re: Problem with p() in straight table

Thank you for your Expression - look pretty well with a double p()... It's better than the one I used before 🙂 For your Information: I used the TOTAL Keyword  at the end of the Expression,  otherwise nothing is displayed (null) .

Unfortunately it's still not producing the desired result. If I select a Category2 it gives the correct value in the sum row (in the Example Volume should be 40.611,839) - I would like to have it in the CE Internet Radio row below (!)

As soon as I deselect the category I continue to get right values in the sum, this time over all categories. I would like to see for each category the correct value...

Honored Contributor II

## Re: Problem with p() in straight table

I am not sure i understand the requirement , can you please elaborate .

please try the below my be

`=sum({<Material_Cat1=, Material_Cat2=, %Deliverynote=P({<Material_Cat2=p(Material_Cat2)>} %Deliverynote) >} Total <Material_Cat2> Volumen)`
Learning never stops.
New Contributor III

## Re: Problem with p() in straight table

Thanks, but it still doesn't work. I will try another appoach...
MVP & Luminary

## Re: Problem with p() in straight table

Ok, I was afraid of that. What you're trying to do is this: https://community.qlik.com/t5/QlikView-Documents/Evaluating-quot-sets-quot-in-the-context-of-a-dimen...

talk is cheap, supply exceeds demand