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

Using a calculated dimension

Hi,

I'm using a calculated dimension:

if(len([Product 12])>1,[Product 12],'No Product')

and in the expression, I'm trying to calculate the following expression and I'm getting the result '-' except for one:

=aggr(count(DISTINCT{<TYPE={1},[Month Diff]={'-10'},[Year Diff]={'0'}>}[orderNum]),

if(len([Product 12])>1,[Product 12],'No Product'))

I'm getting the following table:

if(len([Product 12])>1,[Product 12],'No Product')OrderCount
A100
B-
No Product-

 

*Unfortunately, I'm not allowed to edit the scrip

2 Replies
Yousef_Amarneh
Partner - Creator III
Partner - Creator III

In general, it's better to create the calculated dimensions in the script, but since you are not allowed to edit the script, I think you just need to remove the aggr() function, it's not required in this chart since you are not calculating the value based on different dimension, so your script should be like the below:

count({<TYPE={1},[Month Diff]={'-10'},[Year Diff]={'0'}>} DISTINCT [orderNum])

Yousef Amarneh
Brett_Bleess
Former Employee
Former Employee

Did Yousef's post help you get things working as you wanted?  If so, do not forget to return to the post and use the Accept as Solution button on his post to give him credit for the assistance and let other Community Members know this worked.  If you are still working on things, leave an update on what you still need.

Only thing I can add to Yousef's post that might be of some further help is the following Design Blog post:

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

Hopefully that may help further clarify what Yousef had to say.

Cheers,
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.