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

Total Bar in Bar chart in Qlik Sense

Hi Everyone

This is qlikview snapshot

1.png

I want 'Total' bar in the bottom, which shows the sum of all the bars.

Is this possible in Qliksense???

1 Solution

Accepted Solutions
shraddha_g
Partner - Master III
Partner - Master III

Try:

[KAMC_EAM_ORDERS_BIO_MEDICAL]:

Load *,

     [STATUS_USER] as NewStatus;
Load
WIP_ENTITY_ID,
WIP_ENTITY_NAME As [WO Number],
if(ORGANIZATION_ID=1,'Bio Medical','General Maintenance') as [Organization],
if(PLAN_MAINTENANCE='Y','Preventive','Corrective') as [WO TYPE],
ASSET_GROUP,
STATUS,


if (STATUS = 'Unreleased','Open',
if(STATUS='Draft','Open',
if(STATUS='Complete - No Charges','Complete',
if (STATUS='On Hold','In Progress',
if(STATUS='Released','In Progress',


STATUS))))) as [STATUS_USER],
if(STATUS = 'Unreleased',1,
if(STATUS='Draft',1,
if(STATUS='Complete - No Charges',4,
if(STATUS='On Hold',3,
if(STATUS='Released',3,
if(STATUS='Cancelled',2,
if(STATUS='Closed',5,
if(STATUS='Complete',4,
STATUS)))))))) as [STATUS_USER_ORDER],

DESCRIPTION AS [WO Description],
START_DATE,
year(START_DATE) as [WO Year],
month(START_DATE) as [WO Month],
DATE_CLOSED,
year(DATE_CLOSED) as [WO Closed Year],
month(DATE_CLOSED) as [WO Closed Month];


SQL
Select * from KAMC_EAM_WORK_ORDER_DETAILS where organization_id = 112;


Noconcatenate


NewTable:


Load *,

     [STATUS_USER] as NewStatus

Resident [KAMC_EAM_ORDERS_BIO_MEDICAL] ;

concatenate (NewTable)


Load *,


'Total' as NewStatus


Resident [KAMC_EAM_ORDERS_BIO_MEDICAL] ;


Drop table [KAMC_EAM_ORDERS_BIO_MEDICAL] ;

View solution in original post

13 Replies
shraddha_g
Partner - Master III
Partner - Master III

You can create a new field in the script for your chart:

ReportDimension:

LOAD Distinct MyDim as ReportDim, MyDim Resident MyTable;

Concatenate(ReportDimension)

LOAD Distinct 'Total' as ReportDim, MyDim Resident MyTable;

Then you can use the new field ReportDim instead of MyDim as chart dimension.

Shahzad_Ahsan
Creator III
Creator III
Author

How and where I have to put this in data load editor???

shraddha_g
Partner - Master III
Partner - Master III

In Load Script you can add this.

Consider You have Status Field in attached chart then,

ReportDimension

LOAD Distinct Status as NewStatus, Status , ValueField Resident MyTable;

Concatenate(ReportDimension)

LOAD Distinct 'Total' as NewStatus, Status, ValueField Resident MyTable;

shraddha_g
Partner - Master III
Partner - Master III

If possible provide sample app

Shahzad_Ahsan
Creator III
Creator III
Author

This is my sample qvf

shraddha_g
Partner - Master III
Partner - Master III

Also provide sample data to able to reload app

shraddha_g
Partner - Master III
Partner - Master III

Use below Code in your table:

[KAMC_EAM_ORDERS_BIO_MEDICAL]:
Load
WIP_ENTITY_ID,
WIP_ENTITY_NAME As [WO Number],
if(ORGANIZATION_ID=1,'Bio Medical','General Maintenance') as [Organization],
if(PLAN_MAINTENANCE='Y','Preventive','Corrective') as [WO TYPE],
ASSET_GROUP,
STATUS,
STATUS as NewStatus,
if (STATUS = 'Unreleased','Open',
if(STATUS='Draft','Open',
if(STATUS='Complete - No Charges','Complete',
if (STATUS='On Hold','In Progress',
if(STATUS='Released','In Progress',


STATUS))))) as [STATUS_USER],
if(STATUS = 'Unreleased',1,
if(STATUS='Draft',1,
if(STATUS='Complete - No Charges',4,
if(STATUS='On Hold',3,
if(STATUS='Released',3,
if(STATUS='Cancelled',2,
if(STATUS='Closed',5,
if(STATUS='Complete',4,
STATUS)))))))) as [STATUS_USER_ORDER],

DESCRIPTION AS [WO Description],
START_DATE,
year(START_DATE) as [WO Year],
month(START_DATE) as [WO Month],
DATE_CLOSED,
year(DATE_CLOSED) as [WO Closed Year],
month(DATE_CLOSED) as [WO Closed Month];


SQL
Select * from KAMC_EAM_WORK_ORDER_DETAILS where organization_id = 112;


concatenate

Load *,
'Total' as NewStatus

Resident [KAMC_EAM_ORDERS_BIO_MEDICAL] ;


Use NewStatus as Dimension in Chart

Shahzad_Ahsan
Creator III
Creator III
Author

Sorry Shraddha

I can't provide data for this.

Is there any option to do this at design level???

Shahzad_Ahsan
Creator III
Creator III
Author

This script is running without error but the problem is 'NewStatus' field is showing null value