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

if condition aggregation in pivot table

Hi, I created a pivot table to calculate the OR value, But for the 'Total' is not accurate in red. Due I use if condition.

For  ‘DE='FA DE Enabled' or DE='FA DE Design' or DE='FA DE' or DE='FA DE Edge&AI' or DE='FA DE Design Service Enable'or DE='FA Digital Solution'’ , I re-named it as 'FA Digital Solution' and the calculation for 'FA Digital Solution' is different from other dimension. But it seems not accurate in 'RN' level'.  How to solve this bug. I really appreciate for your reply.

 

SET Expression:

 

if(DE='FA DE Enabled' or DE='FA DE Design' or DE='FA DE' or DE='FA DE Edge&AI' or DE='FA DE Design Service Enable'or DE='FA Digital Solution'
,
Sum({<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Enabled"}>}FA_DE_Enable_OR)

+Sum( {<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Design"}>}[OR Value RMB])

+Sum({<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Design Service Enable"}>}FA_DE_DesignServiceEnable_OR)

+Sum({<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Edge&AI"}>}[OR Value RMB])
,Sum({<[FiscalYear]={$(v_CurrentYear)}>}[OR Value RMB]))

StacyCui_0-1675242116430.png

StacyCui_1-1675242184250.png

 

Labels (3)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Try below

 

=SUM ( AGGR( 

if(wildmatch(DE,'FA DE Enabled','FA DE Design','FA DE','FA DE Edge&AI','FA DE Design Service Enable','FA Digital Solution')
,Sum({<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Enabled"}>}FA_DE_Enable_OR)
+Sum( {<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Design"}>}[OR Value RMB])
+Sum({<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Design Service Enable"}>}FA_DE_DesignServiceEnable_OR)
+Sum({<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Edge&AI"}>}[OR Value RMB])
,Sum({<[FiscalYear]={$(v_CurrentYear)}>}[OR Value RMB])
Dimension1 , Dimension2 , Dimension3 ) )

 

ReplaceDimension1 , Dimension2 , Dimension3  with the fields used in the pivot table

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

Try below

 

=SUM ( AGGR( 

if(wildmatch(DE,'FA DE Enabled','FA DE Design','FA DE','FA DE Edge&AI','FA DE Design Service Enable','FA Digital Solution')
,Sum({<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Enabled"}>}FA_DE_Enable_OR)
+Sum( {<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Design"}>}[OR Value RMB])
+Sum({<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Design Service Enable"}>}FA_DE_DesignServiceEnable_OR)
+Sum({<[FiscalYear]={$(v_CurrentYear)},DE={"FA DE Edge&AI"}>}[OR Value RMB])
,Sum({<[FiscalYear]={$(v_CurrentYear)}>}[OR Value RMB])
Dimension1 , Dimension2 , Dimension3 ) )

 

ReplaceDimension1 , Dimension2 , Dimension3  with the fields used in the pivot table

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
StacyCui
Creator
Creator
Author

Wow, It works. So amazing. Thank you so much.