Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Numbers Mismatch Between Straight and bar Chart

Hi Folks.

I'm using below Expression in straight table , which is giving me right numbers of Cost:

Straight Table:

Dim: KSTAR

        Income_Statement_Line'

Expression=num(if(Main_Order='71410',sum({<Main_Order={'71410','75413'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost),

if(Main_Order='71501',sum({<Main_Order={'71501','75501'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost),

if(Main_Order='71502',sum({<Main_Order={'71502','75502'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost) ,

if(Main_Order='71503',sum({<Main_Order={'71503','75512'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost),

if(Main_Order='71601',sum({<Main_Order={'71601','75614'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost),

sum({<Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost)))))),'#,##0')

but when I'm calling same expression into stacked bar chart , it looks like together numbers are not correct.

Stacked Bar Chart:

Dim: Project Type

        Income_Statement_Line'

Express: as Above

Might be Aggr sum is required , I tried but stoll no sucess.

Please help!

Regards,

AS

5 Replies
amit_saini
Master III
Master III
Author

Guys any suggestion?

Regards,

AS

jonathandienst
Partner - Champion III
Partner - Champion III

>>it looks like together numbers are not correct.


Please be more specific about what you believe to be incorrect. I can't see any wrong numbers in the sample you uploaded.


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
amit_saini
Master III
Master III
Author

Hi Jonathan,

For Main Order = 71601 , correct cost numbers are 2,782,512

X.PNG

So result in Straight table is correct , but when I'm calling same expression in stacked bar chart, I'm having cost total as 2569688.76 (Export bar chart to excel).

It has to be the same as above straight table cost result.

See below Main Order 71601 has a Vpart as 75614 , so in general when I select Main_Order "71601" from list than it should sum up the Cost for both Main Order (71601) and it's corresponding  Vpart (75614) .

Main_OrderVpart
7160175614

Note: All the numbers in Vpart field are available inside "Main_Order" itself.

To achieve this I'm using below expression in straight chart  and Output is correct:

if(Main_Order='71410',sum({<Main_Order={'71410','75413'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost)

I have used above expression , because we are having only 4 cases where Main_Order has Vpart number.

....... similar for

Main_Order  Vpart

71501        75501

71502        75502

Hope it is more clear now!

Thanks,

AS

amit_saini
Master III
Master III
Author

Any suggestions???

Regards,

AS

sunny_talwar

Not entirely sure, but may be this

=num(if(Main_Order='71410',sum(TOTAL <Income_Statement_Line>{<Main_Order={'71410','75413'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost),

if(Main_Order='71501',sum(TOTAL <Income_Statement_Line>{<Main_Order={'71501','75501'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost),

if(Main_Order='71502',sum(TOTAL <Income_Statement_Line>{<Main_Order={'71502','75502'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost) ,

if(Main_Order='71503',sum(TOTAL <Income_Statement_Line>{<Main_Order={'71503','75512'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost),

if(Main_Order='71601',sum(TOTAL <Income_Statement_Line> {<Main_Order={'71601','75614'},Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost),

sum(TOTAL <Income_Statement_Line>{<Income_Statement_Line-={'A - Gross sales','B - Sales Deductions','D - Change in stock / Cap. work & mat.'}>}Cost)))))) * Avg(1),'#,##0')