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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

P() Function Query

Hi All,

I have been working on this specific chart for hours and i have now resorted to Qlikcommunity for much needed help. I have attached a demo model which matched what i am trying to do. It is a rather complicated concept but what i am trying to do is bring back all possible CombinedCat's (field) no matter what i select.

Please let me know if i should explain any further, there is also an explanation in the model attached.

Thanks so much.

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try this expression.

     Sum({$< CombinedCat = P(CombinedCat),Product=>}Sales)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try below expression.

     Sum({$<Product = , Presentation =, Strength =, Ingredient = , Manufacturer = , Category = , SubCategory = ,  Code = P({1<CombinedCat>}Code)>}Sales)

     Hope this is what you want.

Regards,

Kaushik Solanki    

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi Kaushik,

I have applied this syntax. When making a selection, nothing changes. It is as if no selections have been made.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Correct, this is because you have excluded every field in the expression.

    As per me your expression should be like below.

      Sum({$< Code = P({1<CombinedCat>}Code)>}Sales)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

Thanks for your reply again. I have added the modified expression but it is still giving me wrong results. Please see attached the Demo model with your expression as SalesAttempt2.

If i select Product6 in the model it should show me Sales for Product6 and Product7 because they are under the same CombinedCat.

Do you understand my probem?

Sorry for the hassle.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try this expression.

     Sum({$< CombinedCat = P(CombinedCat),Product=>}Sales)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thank you Kaushik,

Works perfectly!!