Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
haupenthals
Contributor III
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)

2png.png

 

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
Gysbert_Wassenaar

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

talk is cheap, supply exceeds demand
haupenthals
Contributor III
Contributor III
Author

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!

pradosh_thakur
Master II
Master II

=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.
haupenthals
Contributor III
Contributor III
Author

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 (!)

Unbenannt4.png

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

 

Unbenannt2.png

 

pradosh_thakur
Master II
Master II

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.
haupenthals
Contributor III
Contributor III
Author

Thanks, but it still doesn't work. I will try another appoach...
Gysbert_Wassenaar

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