Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dimension Calculation to exclude product lines

Hello,

We have a certain dimension calculation that displays the correct amount of product lines for our revenue calculation. We have been tasked with excluding certain product lines from the data in qlik and are stuggling with combining the two formulas.

=aggr(if(sum(wRevenue)>0 or sum(wRevenue)=0,
[wProduct Line]=-{"Apple","Oranges"},[wProduct Line], ))

In essence we want to exclude apples and oranges but keep the aggr function working. Original agg function was:

=aggr(if(sum([wIOI])>0 or sum(wIOI)=0, [wProduct Line]),[wProduct Line])

Thank you so much for your time.

21 Replies
Anonymous
Not applicable
Author

try

=aggr(

if(sum({< wProduct Line]=-{"Apple","Oranges"} >} [wIOI])>0 or sum({< wProduct Line]=-{"Apple","Oranges"} >} wIOI)=0,

only ({< wProduct Line]=-{"Apple","Oranges"} >}

     [wProduct Line])

)

,[wProduct Line])

Anonymous
Not applicable
Author

This expressions errors out in expression box. I think I fixed it but did you check this through the qlik sense expression editor?

Anonymous
Not applicable
Author

corrected it again ...

--------

I cant't test it, because I have no sample data, perhaps try:

=aggr(

if(sum({< [wProduct Line]={"*"}-{"Apple","Oranges"} >} [wIOI])>0 or sum({< [wProduct Line]={"*"}-{"Apple","Oranges"} >} wIOI)=0,

only ({< [wProduct Line]={"*"}-{"Apple","Oranges"} >}

     [wProduct Line])

)

or

=aggr(

if(sum({< [wProduct Line]-={"Apple","Oranges"} >} [wIOI])>0 or sum({< [wProduct Line]-={"Apple","Oranges"} >} wIOI)=0,

only ({< [wProduct Line]-={"Apple","Oranges"} >}

     [wProduct Line])

)

btw

-=

differs from

={"*"} -

Anonymous
Not applicable
Author

Thank you for the helpful formulas, I cannot seem to get it to even give me an OK symbol in the expression box though. I will keep trying.

Anonymous
Not applicable
Author

please post a small inline sample...

Anonymous
Not applicable
Author

I am sorry what do you mean by inline sample?

h_prakash
Creator II
Creator II

Hi Can you please provide sample QVF File

Anonymous
Not applicable
Author

I will talk with my boss and see what he says. Thank you!

Anonymous
Not applicable
Author

have a look here:

Scramble Data