Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

kirsten_dc
New Contributor II

Select a child and get all children which belong to its parent

Hi all,

I want to select an article in a listbox.

In a pivot table I need to get all ticketnumbers in which this article is sold.

Furthermore I want to know the other articles which are sold with the selected one.

The ticketnumbers are the parents and the articles are the children

I have used an expression like this:

=sum({<TestArticleNumber=p({1<TestTicketNumber=p(TestTicketNumber) >}) >} TestAmount)

I don't get why it does not work...

I also added my project so you can take a look.

If you have any idea, please let me know!

Regards,

Kirsten

1 Solution

Accepted Solutions
MVP
MVP

Re: Select a child and get all children which belong to its parent

May be try this

=Sum({<TestArticleNumber, TestTicketNumber=p(TestTicketNumber)>} TestAmount)

8 Replies
MVP
MVP

Re: Select a child and get all children which belong to its parent

May be try this

=Sum({<TestArticleNumber, TestTicketNumber=p(TestTicketNumber)>} TestAmount)

jhoef-pv
New Contributor III

Re: Select a child and get all children which belong to its parent

Hi,

You can't put {1}. {1} omit current selection

Sum({<TestArticleNumber, TestTicketNumber = p(TestTicketNumber)>}TestAmount)

Regards

MVP
MVP

Re: Select a child and get all children which belong to its parent

Where do you see {1} in my expression? I am confused jhoef-pv

isingh30
Contributor III

Re: Select a child and get all children which belong to its parent

Please try this -

=sum({<TestArticleNumber=p({$<TestTicketNumber=p(TestTicketNumber) >}) >} TestAmount)

Thanks.

jhoef-pv
New Contributor III

Re: Select a child and get all children which belong to its parent

Hi stalwar1

I sorry,

I see {1} in the expression kirsten_dc

sum({<TestArticleNumber=p({1<TestTicketNumber=p(TestTicketNumber) >}) >} TestAmount) 

In your expresion is very good.

Sum({<TestArticleNumber, TestTicketNumber = p(TestTicketNumber)>}TestAmount)



kirsten_dc
New Contributor II

Re: Select a child and get all children which belong to its parent

Thank you very much for your fast answer.

I don't get it...

This expression works partially for me. I tried this with another database, too but the result is not the expected one...

What is wrong?

MVP
MVP

Re: Select a child and get all children which belong to its parent

There is a long list of TestTicketNumbers for TestArticleNumber = 135 which makes it difficult to verify if it is working or not... but just by eye-balling, it seems to be working.... why do you think it isn't working? Can you specify exactly what is wrong?

In general, the expression is just saying that ignore selection in TestArticleNumber and show all possible TestTicketNumber... so whatever you see in White in TestTicketNumber will be visible through the expression.

kirsten_dc
New Contributor II

Re: Select a child and get all children which belong to its parent

There were still too much TestTicketNumbers which did not include the selected TestArticleNumbers. But your assertion made me think about it again. In the script I built a new key out of the other columns used in the table - TestTierPath_ID, TestDate and TestTicketNumber. Instead of TestTicketNumber I used my new key in your expression. That works very well

Many thanks for your help!!!

Best Regards

Kirsten

Community Browser