Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Eshwar1
Contributor III
Contributor III

Bar chart to display ALL Bars with including other bars

Hi Everyone,

I am creating one Bar chart with below dimensions and measures

Dim: Div_Code ( For exp 5 Div_codes)

Measure: 1. Sum( {< OrderDate={">=$(=YearStart(Max(OrderDate)))<=$(=Max(OrderDate))"} >}Amt) 

                   2. Sum({<OrderDate={">=$(=MonthStart(Max(OrderDate)))<=$(=Max(OrderDate))"}>}Amt)

each bar is displaying each Div_code this is fine but i want to display One Bar with ALL Div_codes like below image

Eshwar1_0-1699592977286.png

 

how can we display like above image , should we create derived field in script side or front end

if yes how to write the derived field in script or chart expression.

please suggest anyone.

Thank you in advance

-Eshwar

 

 

Labels (4)
1 Solution

Accepted Solutions
Aditya_Chitale
Specialist
Specialist

In your script, create an inline table having the same field name as your DIV CODE field name and use 'All' as value under that inline table field. 

AllDivCode:
load * inline
[
DIVCODE
All
];

concatenate this table to your fact table which contains main DIV CODE field.

In Chart measure expression,  write an if() condition:

=if(DIVCODE='All', sum(total Sales), sum(Sales))

 

Sample data used:

Aditya_Chitale_0-1699601584308.png

 

Output:

Aditya_Chitale_1-1699601612191.png

 

Regards,

Aditya

 

View solution in original post

2 Replies
Aditya_Chitale
Specialist
Specialist

In your script, create an inline table having the same field name as your DIV CODE field name and use 'All' as value under that inline table field. 

AllDivCode:
load * inline
[
DIVCODE
All
];

concatenate this table to your fact table which contains main DIV CODE field.

In Chart measure expression,  write an if() condition:

=if(DIVCODE='All', sum(total Sales), sum(Sales))

 

Sample data used:

Aditya_Chitale_0-1699601584308.png

 

Output:

Aditya_Chitale_1-1699601612191.png

 

Regards,

Aditya

 

Eshwar1
Contributor III
Contributor III
Author

Thank you Aditya for u r reply .

it is working as expected.

But trying to achieve with diff expression is not working.

If(DIVISION_CODE='ALL',Sum(Total Sales)/Sum(CST_CNT),Sum(Sales)/Sum(CST_CNT))

Can u suggest on this.

Thanks in advance

-Eshwar