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: 
FBSK
Contributor II
Contributor II

Aggregation in table

FBSK_0-1733151825342.pngFBSK_1-1733151831623.png

FBSK_2-1733151977297.pngFBSK_3-1733151989666.png

 

In my Qliksense app, I have two tables that is showing the cost/volume but it is aggregating the result differently. As you can see the total is accurate in both tables, but in one table the result is presented as a % of the total and in the other it is presenting the total for the region (as I want it). The difference between the table is the period selections as they are connected to different selections. The underlying data is the same though. I have a feeling this is an easy fix. Anyone that can help?

Labels (1)
1 Solution

Accepted Solutions
FBSK
Contributor II
Contributor II
Author

Issue is solve:

Instead of using the variable v_DTS_FOR_INTERVAL1, I just copied the formula inside and used it directly and it worked. Is this a bug within Qlik?

View solution in original post

3 Replies
Mark_Leifeld
Partner - Creator
Partner - Creator

Hi @FBSK

 

can you provide the formula you used for calculating the measures ? Or are they identical ? 

FBSK
Contributor II
Contributor II
Author

Hi @Mark_Leifeld,

 

Sure, sorry it's quite long with variables included. Please tell me if you want me to provide you the variables as well.

Measure giving the result in the wrong "format":

=fabs((sum({$<Year,Period,[Statement Type 2]={'IS'},[Scenario]= {'$(v_SCENARIOCOMP1)'},Period={">=$(=v_CHOOSE_STARTCOMP1)<=$(=v_CHOOSE_ENDCOMP1)"}>} Value)))

/

v_DTS_FOR_INTERVAL1

 

The correct format:

if('$(v_ISO_YTD1)'='ISO',
Sum({<[Statement Type 2]={'IS'},[Scenario]= {'$(v_SCENARIO1)'},Period={'$(v_CHOOSE_PERIOD1)'}>} Value),
if('$(v_ISO_YTD1)'='YTD',
Sum({<[Statement Type 2]={'IS'},[Scenario]= {'$(v_SCENARIO1)'},Period ={">=$(=(v_FIRST_PERIOD1))<=$(=(v_CHOOSE_PERIOD1))"}>} Value),
if('$(v_ISO_YTD1)'='$(v_QUARTER1)',
Sum({<[Statement Type 2]={'IS'},[Scenario]= {'$(v_SCENARIO1)'},Period={"<=$(v_CHOOSE_PERIOD1)"},Quarter={'$(v_LATEST_QUARTER1)'},Year ={'$(v_CURRENT_YEAR1)'}>}Value))))

/

if('$(v_ISO_YTD1)'='ISO',
Sum({<[Lvl 1],[Lvl 2],[Lvl 3],[Lvl 4],[Lvl 5],[Lvl 6],[Lvl 7],[Lvl 8],[Lvl 9],[Cost_Surcharges],[Cost or Surcharge],[Allocations],[Cost Surch. Groups],[Cost Surch. Next Lvl],[Cost Surch. Lvl 1],[Flash Groups],[Flash Next Lvl],[Lvl 2 Vol]={'FS Deliveries to std Recalc'},[Scenario]= {'$(v_SCENARIO1)'},Period={'$(v_CHOOSE_PERIOD1)'}>} Value),
if('$(v_ISO_YTD1)'='YTD',
Sum({<[Lvl 1],[Lvl 2],[Lvl 3],[Lvl 4],[Lvl 5],[Lvl 6],[Lvl 7],[Lvl 8],[Lvl 9],[Cost_Surcharges],[Cost or Surcharge],[Allocations],[Cost Surch. Groups],[Cost Surch. Next Lvl],[Cost Surch. Lvl 1],[Flash Groups],[Flash Next Lvl],[Lvl 2 Vol]={'FS Deliveries to std Recalc'},[Scenario]= {'$(v_SCENARIO1)'},Period ={">=$(=(v_FIRST_PERIOD1))<=$(=(v_CHOOSE_PERIOD1))"}>} Value),
if('$(v_ISO_YTD1)'='$(v_QUARTER1)',
Sum({<[Lvl 1],[Lvl 2],[Lvl 3],[Lvl 4],[Lvl 5],[Lvl 6],[Lvl 7],[Lvl 8],[Lvl 9],[Cost_Surcharges],[Cost or Surcharge],[Allocations],[Cost Surch. Groups],[Cost Surch. Next Lvl],[Cost Surch. Lvl 1],[Flash Groups],[Flash Next Lvl],[Lvl 2 Vol]={'FS Deliveries to std Recalc'},[Scenario]= {'$(v_SCENARIO1)'},Period={"<=$(v_CHOOSE_PERIOD1)"},Quarter={'$(v_LATEST_QUARTER1)'},Year ={'$(v_CURRENT_YEAR1)'}>}Value))))

 

 

FBSK
Contributor II
Contributor II
Author

Issue is solve:

Instead of using the variable v_DTS_FOR_INTERVAL1, I just copied the formula inside and used it directly and it worked. Is this a bug within Qlik?