Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pedro_freire
Contributor III
Contributor III

Evaluate Chart Expression at line level - Part2

Hello guys and thank you again for all your help!

As for the solutionstalwar1 presented, it work perfectly until we had to move up one "notch".

On the January problem, we had one table with a one-to-one relationship between productcode and market.

Now we have grouped Products and for each ProductGroup it's possible to have more than one Product and More than one Market.

Untitled2.png !

The expected result shoul be somthing like this:

Untitled.png

Like in January, the main objective is to to have a table where, for the stores that have soled each ProdCode we will have the Sum(SalesUnits) for the Sub-Markets (Categories) where this ProductCode belongs to.

Once again I thank you for your help!

Pedro Freire

Message was edited by: Pedro Freire

1 Solution

Accepted Solutions
sunny_talwar

Avoiding the synthetic key in the attached example.... but will take slightly longer to run....

View solution in original post

9 Replies
Anil_Babu_Samineni

I do check your FACT excel. There showing only this, What was the logic behind on it? Can you check your excel whether the values are corrupted or same

 

Prod_BMV10000963
Prod_DUCATE22425
Prod_ONDA20631
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pedro_freire
Contributor III
Contributor III
Author

Hello Anil,

The FACT Excel has 2 sheets:

The FACTS sheet has the Data that is loaded into the example3.qvw.

The Expected Results sheet has some Pivot Tables with the expected result for each Product (BMV, DUCATE, ONDA).

The Logic behind the calculation for BMV, for example, is as follows:

  1.      For the Stores that sold (SContrib=1)  bike BMV (Cascais, Ericeira, Espinho, Lisboa e Nazaré);
  2.      do Sum (SalesUnits) of the Sub-Market where BMV belongs (Trail, Café-Racer)

Untitled3.png

Hope this helps.

Thank you

sunny_talwar

I started looking at this yesterday and it seems fairly complex.... but having said that, I am still looking at this and will revert back if I find something.

pedro_freire
Contributor III
Contributor III
Author

Ok. Thanks Sunny.

Pedro

sunny_talwar

May be there is a better way to do this and this might not be 100% correct.... but look at the attached

Capture.PNG

Prod_DUCATE isn't matching, but the Excel did not select all the Stores?

Capture.PNG

Lisboa and Nazare were not included, is there a reason why they were not included for Prod_DUCATE? Once I include them, the number changes to 10043269 which matches with the output I am getting above.

pedro_freire
Contributor III
Contributor III
Author

The reason is that Lisboa and Nazaré haven't sold Prod_DUCATE (any of its Packs) and they shouldn't be considered for its calculation.

Check SalesUnits for Prod_DUCATE in this stores =0.

The SContrib qualifier sets in Fact-table if the product was soled or not.

Nevertheless, you are allmost there.

sunny_talwar

Check now....

pedro_freire
Contributor III
Contributor III
Author

I think you got it!

I'll see if this synthetic table will not impact on dashboard performance, as it's another big issue on the original app,

but as far as the model goes, it works fine!

Thank you once again Sunny!

sunny_talwar

Avoiding the synthetic key in the attached example.... but will take slightly longer to run....