Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate only Child value when Parent value is selected.

Hello again Qlik Masters,

Good day to you all.

I have a Fact table that consists of Regional and Value columns, like so.

Fact Table sample.PNG

I have a Dimension called Dim_Region table that consists of Regional and Area columns, like so.

Dim Table sample.PNG

Both tables are linked using the Regional columns.

Regional acts as the Parent and Area acts as the Child.

My objective is to create a straight table with expression to Sum the Value but based on the value of the children's value when the parent is selected.

Is there any workaround for this issue?

For Example:

When the user chooses Regional = NATIONAL, then the table should consists of Values of NATIONAL's children (REGIONAL A, REGIONAL B, REGIONAL C, REGIONAL D, REGIONAL E.....REGIONAL L). The expected result is shown below.

Main Analysis.PNG

Note: The chart above is still hardcoded. So it is still wrong.

Thank you in advance. And feel free to ask if there's any question regarding my problem.

You can find it in the attached QVW

--Adam Ginza--

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like this:

SUM(

  {<

  Fact_Flag = {"FCC"} ,  

  REGIONAL = p(AREA) ,

  FACT = {'Volume in Sticks'} , SKU = {'Cigarette'}, YearMonth_Num = {"$(=MAX({<Fact_Flag={'FCC'}>}YearMonth_Num))"}

  >}

Value)

View solution in original post

3 Replies
rahulpawarb
Specialist III
Specialist III

Hello Adam,

Attached is the draft work around. Please correct me in case I misunderstood the requirement.

Regards!

Rahul

tresesco
MVP
MVP

May be like this:

SUM(

  {<

  Fact_Flag = {"FCC"} ,  

  REGIONAL = p(AREA) ,

  FACT = {'Volume in Sticks'} , SKU = {'Cigarette'}, YearMonth_Num = {"$(=MAX({<Fact_Flag={'FCC'}>}YearMonth_Num))"}

  >}

Value)

Anonymous
Not applicable
Author

Hi Tresesco,

Your solution seems to work for me.

Thank you all for your help.

--Adam Ginza--