Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
srikanth1994
Contributor
Contributor

How to show two years data side by side in table

Hi Qlik learners,

User given 6 segment buckets for the revenue for 2021 and given segments for 2022 given different segments

so, for one ID he wants to see the segment for 2021 and 2022 by side by side 

so written the expression like 

Ex:for 2022

aggr(if(Year='2022',if((
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)

Ex :for 2021

aggr(if(Year='2021',if((
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)

so when i am selected the particular year it was showing the the selected year data ,when i am selected two years ,it 

not showing anything ,so he want the data without selecting any year ,he want 2022 data in one filed and 2021 in another filed side by side comparison  ,

 

please suggest me how we can achieve

1 Solution

Accepted Solutions
Vegar
MVP
MVP

wow that was a lot of expressions! 

I think you need to add the Year={2021} to all your sum expressions. Then you can remove the IF(Year=2022...) statement from your expression.

View solution in original post

3 Replies
Vegar
MVP
MVP

What about using a set modifier for Year?

 

Sum({<Year={2022}, [CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)

Sum({<Year={2021}, [CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)

srikanth1994
Contributor
Contributor
Author

Hi Vegar,

The expression is :

aggr(if(Year='2022',if((
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)
+
Sum({<[CM-Calc-1-Costs]={1}>}ALLOCATED_OPEX_COST)
)
/
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)<0 And
(if(Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST)>=1,Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST))

<98000),'Value destructive customers' ,
if((
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)
+
Sum({<[CM-Calc-1-Costs]={1}>}ALLOCATED_OPEX_COST)
)
/
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)<0 And
(if(Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST)>=1,Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST))

>98000),'Chronically in efficient customers' ,
if((
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)
+
Sum({<[CM-Calc-1-Costs]={1}>}ALLOCATED_OPEX_COST)
)
/
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)>0 and
(
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)
+
Sum({<[CM-Calc-1-Costs]={1}>}ALLOCATED_OPEX_COST)
)
/
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)<0.63 and
(if(Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST)>=1,Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST))

<98000),'Low value customers' ,
if((
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)
+
Sum({<[CM-Calc-1-Costs]={1}>}ALLOCATED_OPEX_COST)
)
/
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)>0 and
(
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)
+
Sum({<[CM-Calc-1-Costs]={1}>}ALLOCATED_OPEX_COST)
)
/
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)<0.63 and
(if(Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST)>=1,Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST))

>98000),'Inefficient customers' ,
if((
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)
+
Sum({<[CM-Calc-1-Costs]={1}>}ALLOCATED_OPEX_COST)
)
/
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)>0.63 And
(if(Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST)>=1,Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST))

<98000),'Untapped customers' ,
if((
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)
+
Sum({<[CM-Calc-1-Costs]={1}>}ALLOCATED_OPEX_COST)
)
/
Sum({<[CM-Calc-1-Revenue]={1}>}ALLOCATED_OPEX_COST)>0.63 And
(if(Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST)>=1,Sum({<[Calc-Recurring-Revenue]={1}>}ALLOCATED_OPEX_COST))

>98000),'High value customers'))))))),[Parent OCN]);

When i am adding  this getting error as invalid dimension 

Sum({<Year={2022}

Sum({<Year={2021}

Vegar
MVP
MVP

wow that was a lot of expressions! 

I think you need to add the Year={2021} to all your sum expressions. Then you can remove the IF(Year=2022...) statement from your expression.