Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Script wise Dimension

Guys,

I have the data as shown below,

FieldCustomerID
AC11
BC22
CC13
DC21

Expected Output:

Screenshot_20.png

I want the no. of Fields which has same IDs. Both fields have same IDs but from different customers in the above bar chart. I've got the answer for this using expression, but I need to bring it as a dimension in script.

Please help.

19 Replies
sunny_talwar

Dimension

=Aggr(If(Count(TOTAL <ID> Customer) >= 2, Customer), ID, Customer)

Expression

Count(DISTINCT Customer)

Anonymous
Not applicable
Author

No, Instead of using this in calculated dimensions, can we make it as dimension storing only the measure values in it?

sunny_talwar

Not sure I understand

Anonymous
Not applicable
Author

Sunny, I'll explain my requirement in detail.

Assume I have 3 customers, each having some number of fields. When a customer is selected, I need to show the number of fields which are exactly same in other 2 customers by comparing the fields of selected customer.

To achieve this, I've used P() and E() function,

Count({<Customer=E(Customer),WithProp_ID=P(WithProp_ID)>}FieldName)


But if data increases, I was informed that these expressions in the front end may affect the performance(load time).

So I need to calculate those expressions in the script itself since it can increase the performance. Am I right? can we do like this?

or can I proceed with this method itself?

sunny_talwar

Doing something in script definitely improves performance, but not everything can be moved to the script. In your case where you plan to make selections, it might not be possible to move something to the script.... but then again, if this is just based on selection in customer and no other selection needs to be made or if made can be ignored, then you might be able to do this in the script.... it all depends on what you have and how you are executing this.

Anonymous
Not applicable
Author

okay. Can we use set analysis expressions in the script, because I'm trying to use this in script.

sunny_talwar

Set analysis can only be used on the front end, not available in script. You can replicate set analysis using if statement.

Anonymous
Not applicable
Author

Sunny, I've attached the sample data and QVW file with this. But could you help me to make this expression into a dimension?

sunny_talwar

Which expression.... attached qvw doesn't have any object in it? Which expression needs to be converted to a dimension?