Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
BrianDH
Creator II
Creator II

Filter Table object

I have a 10 column table with some dimensions and some measures.   Globally I only want to show the rows where the below calculation is = true  .  The below Calculation is one of my measure columns.

I am looking for examples.

if(SUM(B_BH_AMOUNT_ACT +
B_BH_AMOUNT_PAY +
B_BH_AMOUNT_GLA +
B_BH_AMOUNT_GLL +
B_BH_AMOUNT_GLQ +
B_BH_AMOUNT_GLR +
B_BH_AMOUNT_GLE +
B_BH_AMOUNT_OTHER)
>
Sum(B_BH_AMOUNT_ACC), 'true', 'false')

 

Thanks

Labels (2)
1 Solution

Accepted Solutions
BrianDH
Creator II
Creator II
Author

I got it working!  =Aggr(if($(vSpend)=1,MasterKey),MasterKey)

I need to filter the rows off the master key! 

AutoNumber((B_BUSINESS_UNIT) & '_'& (B_PROJECT_ID)) as MasterKey,

View solution in original post

32 Replies
lorenzoconforti
Specialist II
Specialist II

if(SUM(B_BH_AMOUNT_ACT +
B_BH_AMOUNT_PAY +
B_BH_AMOUNT_GLA +
B_BH_AMOUNT_GLL +
B_BH_AMOUNT_GLQ +
B_BH_AMOUNT_GLR +
B_BH_AMOUNT_GLE +
B_BH_AMOUNT_OTHER)
>
Sum(B_BH_AMOUNT_ACC), YourMeasure)

BrianDH
Creator II
Creator II
Author

I get Invalid Dimension using

=if(SUM(B_BH_AMOUNT_ACT +
B_BH_AMOUNT_PAY +
B_BH_AMOUNT_GLA +
B_BH_AMOUNT_GLL +
B_BH_AMOUNT_GLQ +
B_BH_AMOUNT_GLR +
B_BH_AMOUNT_GLE +
B_BH_AMOUNT_OTHER)
>
Sum(B_BH_AMOUNT_ACC), 'True')

BrianDH
Creator II
Creator II
Author

maybe i am placing the formula in the wrong place.  Where does the above script need to be located? 

lorenzoconforti
Specialist II
Specialist II

You would need to use the code in your measure

 

If(condition, measure)

BrianDH
Creator II
Creator II
Author

This is a measure

>>



if(SUM(B_BH_AMOUNT_ACT +

B_BH_AMOUNT_PAY +

B_BH_AMOUNT_GLA +

B_BH_AMOUNT_GLL +

B_BH_AMOUNT_GLQ +

B_BH_AMOUNT_GLR +

B_BH_AMOUNT_GLE +

B_BH_AMOUNT_OTHER)

>

Sum(B_BH_AMOUNT_ACC), 'true', 'false')



<<


lorenzoconforti
Specialist II
Specialist II

I understand, you want to show measures where your condition is true. Let's say the measure you want to show is sum(B_BH_AMOUNT_ACT) then, in your measure field, you would write: 

 

if(SUM(B_BH_AMOUNT_ACT +

B_BH_AMOUNT_PAY +

B_BH_AMOUNT_GLA +

B_BH_AMOUNT_GLL +

B_BH_AMOUNT_GLQ +

B_BH_AMOUNT_GLR +

B_BH_AMOUNT_GLE +

B_BH_AMOUNT_OTHER)

>

Sum(B_BH_AMOUNT_ACC), sum(B_BH_AMOUNT_ACT))

 

Which means, when the condition is met (i.e. when your original condition evaluates to true), show the data

BrianDH
Creator II
Creator II
Author

Oh so I would do that for each column, within Show Column if?

lorenzoconforti
Specialist II
Specialist II

yes, for each measure. I would recommend to create a variable with your condition (if it's the same across all the measures) and reference that variable instead (it avoid re-writing the code and makes it easier to manage if you need to make any changes)

BrianDH
Creator II
Creator II
Author

Will this also work for my columns that are dimensions?