Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Set Analysis Issue

Hello - I can't get the syntax in this expression to work with set analysis. Does anyone see an issue?

 

(({$<[Test1] = {"Apple"}>}[Test1]) - {$<[Test1] = {"Orange"}>}[KPD_KPI_ID]+ ({$ <[Test1] = {"Apple"}>}[Test1])) / ({$ <[KPD_KPI_ID] = {"Orange"}>}[Test1])

Tags (1)
1 Solution

Accepted Solutions

Re: Set Analysis Issue

Only thing you can try to change here would be replacing the double quotes with single quotes:

Sum({$< = {'Internal', 'Store'}, [Plant] -= {'Test'}>}[ABC]) / Sum({$< = {'Internal', 'Store'}, [Plant] -= {'Test'}>}[ABC])


I am assuming that X, ABC are all dummy, so when you replace them with the actual do make sure to check for upper case and lower case as everything in here will be case sensitive.


Best,

Sunny

5 Replies
MVP
MVP

Re: Set Analysis Issue

there is no function (sum, avg, count, etc....)

sum({$<Region={USA}>} Sales)

also I don't understant your requirement? could you explain?

Re: Set Analysis Issue

I don't see any sum/count/min/max in your expression???

(({$<[Test1] = {"Apple"}>}[Test1]) - {$<[Test1] = {"Orange"}>}[KPD_KPI_ID]+ ({$ <[Test1] = {"Apple"}>}[Test1])) / ({$ <[KPD_KPI_ID] = {"Orange"}>}[Test1])

This part needs to be something like this:

({$<[Test1] = {"Apple"}>}[Test1]) - > Sum/Count/Min/Max/Only({$<[Test1] = {"Apple"}>}[Test1])


and similarly all the individual parts would need a aggregation in the expression.


HTH


Best,

Sunny

Not applicable

Re: Set Analysis Issue

Hi Sunindia, thank you for helping! Do you see an issue with this set analysis syntax? its not working either

 

Sum ({$< = {"Internal", "Store"}, [Plant] -= {"Test”}>}[ABC])/ Sum ({$ < = {"Internal", "Store"}, [Plant] -= {"Test”}>}[ABC])

Re: Set Analysis Issue

Only thing you can try to change here would be replacing the double quotes with single quotes:

Sum({$< = {'Internal', 'Store'}, [Plant] -= {'Test'}>}[ABC]) / Sum({$< = {'Internal', 'Store'}, [Plant] -= {'Test'}>}[ABC])


I am assuming that X, ABC are all dummy, so when you replace them with the actual do make sure to check for upper case and lower case as everything in here will be case sensitive.


Best,

Sunny

MVP
MVP

Re: Set Analysis Issue

what's the meaning of your last expression; it seems the result should be 1?

Sum ({$< = {"Internal", "Store"}, [Plant] -= {"Test”}>}[ABC])

/

Sum ({$< = {"Internal", "Store"}, [Plant] -= {"Test”}>}[ABC])

Community Browser