Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Restrict view in Straight Table

Morning All,

I have created a rec in a straight table. However, I only want to see rows where I have values (ie non null and non zero) for both my data sources. eg in the following:

IDBalanceABalanceBDiff
11011001
2025-25
351051
414212220


I only want to see rows 1 and 4.

Can I do this in a Straight Table?

TIA

Tony

1 Solution

Accepted Solutions
Not applicable
Author

I missed that BalanceA & BalanceB was expression.

You have to do like this

=

if(BalanceA<> 0 and BalanceB<> 0,ID)





and

mark Supress when value is NULL.

then you get this

Anders

=if(BalanceA<> 0 and BalanceB<> 0,ID)sum(BalanceA)sum(BalanceB)sum(BalanceA) - sum(BalanceB)
24322221
11011001
414212220


View solution in original post

13 Replies
spsrk_84
Creator III
Creator III

Hi,

Yes it is possible .please find the attached files and in the file i have created one more dimesion called as @@ID and applied the logic u said .One more thing when u take the dimesion @@ID in straight table dont forget to check/enable the option i.e "Supress When Value IS NuLL " in the Dimesion tab of the Straight table window.

Regards,

ajay

spsrk_84
Creator III
Creator III

Hi,

I forgot to upload the Qvw file ,please find the attached....

Regards,

Ajay

Not applicable
Author

In short: you need to have NULL values instead of 0 values Wink

Not applicable
Author

Thanks for all the help guys, but there's a few things I forgot to mention.... Embarrassed

Firstly, I'm using Personal Edition, so unfortunately it seems I can't open anyone else's files. But I get the idea from what you've written that I need to introduce a NullFlag sort of field which is Null when either of my sources is zero.

However.... my BalanceA and BalanceB are not dimensions, but are expressions and are actually sums, ie Sum(BalanceA) and Sum(BalanceB).

I've been experimenting with the NullFlag field and it seems I can create it as an expression, which works great, but then I can't filter out records when an expression is null. Is that correct?

Alternately if I try to create the sums of BalanceA and BalanceB as calculated dimensions I just get the old "Error in calculated dimension" message.

Any ideas?

Thanks,

Tony

Not applicable
Author

Use Calculated Dimensions then 🙂

When you go to the Dimensions tab, you will see that you can also add Calculated Dimensions (button right-middle).

Not applicable
Author

When I try calculated dimensions I get "//Error in calculated dimension". Any ideas why that might be? Could it be because I have Nulls in the source data? I don't get it because sum(SourceA) works as an expression but not as a calculated dimension. Confused

Tony

Not applicable
Author

Hmm, expressions like SUM and COUNT don't work like that in a calculated dimension. It's really meant for stuff like adding text or if statements, etc.

Samples:


='ID: '&ID/2
=if(ID<10000,ID+10000,ID)


So make the Sum(SourceA) into a dimension, it must be loaded as a dimension (calculation while loading and putting the result in a field).

Not applicable
Author

OK, thanks Mark. I'm wondering if I should try doing this in a Pivot Table instead. There must be some way to exclude zero values from a pivot table.... surely?

Tony

Not applicable
Author

If you write

=

if(BalanceA<> 0,BalanceA)

and



=

if(BalanceB<> 0,BalanceB)





in calculatet dimension

and

mark Supress when value is NULL it will work.

Anders