Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

prashantsanchet
Contributor

2 bar chart having same expression but different dimension different results

Bar Chart 1:

Dimension : Region

measure:

if (sum([Quantity]) <> 0,

if (Sum([DailyQuantitySales]) <> 0,


sum({<[Region] ={"=Sum([margin])>=0"} >}[DailySales]) - sum({<[Region] ={"=Sum([margin])>=0"} >}[DailyVarSales]),

sum({<[Region] ={"=Sum([margin])>=0"} >}[DailySales])

)

,0)

Bar Chart 2:

Dimention : Country

if (sum([Quantity]) <> 0,

if (Sum([DailyQuantitySales]) <> 0,

sum({<[Country] ={"=Sum([margin])>=0"} >}[DailySales]) -sum({<[Country] ={"=Sum([margin])>=0"} >}[DailyVarSales]),

sum({<[Country] ={"=Sum([margin])>=0"} >}[DailySales])

)

,0)

Both are giving different total . What could be the reason ?

2 Replies
shraddha_g
Honored Contributor III

Re: 2 bar chart having same expression but different dimension different results

can you create a sample application and share it?

hacr-sds
Contributor

Re: 2 bar chart having same expression but different dimension different results

Aren't you making 2 totally different calculations, as one is looking at Country = and Region =? Maybe you need some identifiers to user alle data

https://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/ChartFunctions/SetAnalysis/se...

A simple app or data-set would make it easier to solve.