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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis not working properly

Hi all

I have this expression which i can't get to work properly,

Sum({<FrontLossFlag ={'*'} - {'1'}, DataSource = {'*'} - {'DPW' , 'DEX (DPW)' }>} Real)

If I remove either 'DPW' or 'DEX (DPW)', then it works. But not if both a left inside the expressions, then it return the value of zero, which isn't correct.

I can't seem to figure what I'm doing wrong? I've also tried inserting '[ DEX (DPW) ] ', however this doesn't return the correct value either.

I hope someone can help

Regards

Stefan

23 Replies
tomovangel
Partner - Specialist
Partner - Specialist

Have you tried using Aggr() ?

antoniotiman
Master III
Master III

Why not

DataSource -= {'DPW' , 'DEX (DPW)' }

Anil_Babu_Samineni

What if you are trying something like below

Sum({<FrontLossFlag -= {'1'}, DataSource -= {'DPW' , 'DEX (DPW)' }>} Real)


Note - I assume DEX (DPW) is not valid name. Will you check same

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Kushal_Chawda

you can replace the key word in script like below and then use it in set analysis

LOAD *,

          if(DataSource ='DEX (DPW)','DEX_DPW',DataSource ) as DataSourceNew


Sum({<FrontLossFlag ={'*'} - {'1'}, DataSourceNew= {'*'} - {'DPW' , 'DEX_DPW' }>} Real)

Anonymous
Not applicable
Author

Hi Antonio

I've tried that also, and it doesn't work.

Anonymous
Not applicable
Author

Hi Anil

I've tried above alsp and it doesn't work.

If I make the expressions as none set analysis then it work.

Sum(if(FrontLossFlag <> '1' AND DataSource <> 'DPW' AND DataSource <> 'DEX (DPW)' , Real))

So DEX (DPW) is a valid name.

Not applicable
Author

It's pretty difficult to solve these problems without more information and some sample data. 

You need to isolate the issue.  Can you first confirm that this works in isolation and filters just for the values you want to exclude:

Sum({<DataSource ={'DPW' , 'DEX (DPW)' }>} Real)

Sum({<FrontLossFlag ={'1'}>} Real)

If so, then perhaps you could try something like this:

Sum({

<FrontLossFlag =, DataSource =>

-

<FrontLossFlag ={'1'}, DataSource = {'DPW' , 'DEX (DPW)' }>} Real)

Anonymous
Not applicable
Author

Hi Kushal

I would prefer not scripting me out of this.

Anonymous
Not applicable
Author

Hi Angel

No I haven't, would you do that?