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

show the yearwise data for the single dimension with multiple values

 hi,

i am having below structure like tables,joined by A1 and A2, for the Selection year=2020 and quarter=q2 and A1=x and A2=y

Table1     
yearquarterWeekA1A2sales
2018q224xy100
2019q224xy200
2020q224xy100

 

Table2    
YRQTRA1A2Cat
20192xyapple
20202xyball

Output i am having in straight table , by

Sum({<YR={"$(=only(Year))"},QTR={'2'}>}$(vSales))

Sum({<YR={"$(=only(Year)-1)"},QTR={'2'}>}$(vSales))

DimensionsDimensionsDimensionsExpressionExpression 
CatA1A2Sumsales CYSumsales PyCount(Sales units)
Ballxy10001
applexy02001

For the same selection, user expecting only Ball but with previous year data in straight table and cat's count

DimensionsDimensionsDimensionsExpressionExpression 
CatA1A2Sumsales CYSumsales PyCount(Sales units) Py
Ballxy1002001

only(aggr(distinct Cat,year,quarter)) is not working in dimensions, the selection objects is year=2020 and quarter=q2 and A1 =X and A2=y. i am struck in calculating the py sales and py count because of the dimension is Cat. i am not sure this scenario is the slowly changing dimensions.i  dont have much idea now.is any one overcome the same scenario ? any advice ? Thanks in advance.

Regards

Yogesh.

1 Reply
Brett_Bleess
Former Employee
Former Employee

Have a look at the following Design Blog post, may be what you need, not sure:

https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.