Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
i am using aggr function in an expression but performance is heavily affected. is there any alternate?
Maybe like this
| country | FType | If( FType = 'Client', sum({<Type = {ClientID}>}sales) , sum({<Type = {CustomerID}>}sales) ) |
|---|---|---|
| 800 | ||
| Pakistan | Customer | 400 |
| UK | Client | 200 |
| USA | Client | 100 |
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)
)
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?
Give a try on the below:
sum({<Type = {'$(vFType)'}>}sales)
no luck, syntax error in set modifier e
How did you defined your vFType ? Meaning if you had a = while defining the variable then remove the = and it should work.
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 | ||
| Pakistan | Customer | 400 |
| UK | Client | 200 |
| USA | Client | 100 |