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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
gauthamchilled
Creator
Creator

equivalent for aggr

hi

i am using aggr function in an expression but performance is heavily affected. is there any alternate?

Labels (1)
16 Replies
swuehl
Champion III
Champion III

Maybe like this

country FType If( FType = 'Client', sum({<Type = {ClientID}>}sales) , sum({<Type = {CustomerID}>}sales) )
800
PakistanCustomer400
UKClient200
USAClient100
gauthamchilled
Creator
Creator
Author

hi stefan,

i could able to write the if condition, but the problem is there are other business conditons in the expression and performance is bad,

is there a way to simplify this using set analysis

If( FType = 'Client',

sum({<Type = {ClientID}>}sales)

, sum({<Type = {CustomerID}>}sales)

)

gauthamchilled
Creator
Creator
Author

i tried something like this  sum({<Type = {$(=vFType)}>}sales)...may i know why the variable is not picking client ID or Customer ID based on the country which is used as dimension?

trdandamudi
Master II
Master II

Give a try on the below:

sum({<Type = {'$(vFType)'}>}sales)

gauthamchilled
Creator
Creator
Author

no luck, syntax error in set modifier e

trdandamudi
Master II
Master II

How did you defined your vFType ? Meaning if you had a = while defining the variable then remove the = and it should work.

swuehl
Champion III
Champion III

Maybe consider simplifying your data model. You can easily create a flag field that flag the facts you want to sum.

country FType Sum({<FactFlag = {1}>} sales)
700
PakistanCustomer400
UKClient200
USAClient100