Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 |
A | 100 |
B | - |
No Product | - |
*Unfortunately, I'm not allowed to edit the scrip
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])
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