Good afternoon, I have a problem with an expression I am using in a flat table, There is a field that has a value of either 1 or 2 for each BP, without a listbox restricting either 1 or 2 neither will show and returns a value of '-' a null.
I tried the Expression :-
if(Meter_Reading_Reason='01' and Meter_Reading_Type='01' or
Meter_Reading_Reason='02' and Meter_Reading_Type='01' or
Meter_Reading_Reason='01' and Meter_Reading_Type='02' or
Meter_Reading_Reason='02' and Meter_Reading_Type='02',BP)
I have tried to remedy the problem with the expression below (which doesn't work either)
if(Meter_Reading_Reason='01' and Meter_Reading_Type='01' and Meter_Reading_Reason<>'02' and Meter_Reading_Type<>'02' or
Meter_Reading_Reason='02' and Meter_Reading_Type='01' and Meter_Reading_Reason<>'01' and Meter_Reading_Type<>'02'or
Meter_Reading_Reason='01' and Meter_Reading_Type='02' and Meter_Reading_Reason<>'02' and Meter_Reading_Type<>'01'or
Meter_Reading_Reason='01' and Meter_Reading_Type='02' and Meter_Reading_Reason<>'02' and Meter_Reading_Type<>'01',BP)
Meter reading type and meter reading reason vary over different meter reads, they can be 1 or/and 2. What I am trying to achieve is to load Value 'BP' if either Meter reading reason or meter reading type fit these criteria.
Hi Kiran, there is no error in the code, the most part of the code is associative table link such as Customer<=>Contract<=>Property<=>Meter<=>Meter_Readings.
Have I written the expression incorrectly, I am trying to write an expression where if Meter reading reason = 1 or 2 and meter reading type = 1 or 2 then return me customers (BP) that have these types of reads on their accounts, if they have meter reading reason/type other than 1 or 2 I dont want them.
There is no syntax (or logical) mistake in your expression as far as I can see. Since the condition is not satisfied or for the satisfied records there are no BP, I assumed some discrpency is the data against your assumption.
Just to confirm, are your fields "Meter_Reading_Reason" and "Meter_Reading_Type" numeric or string? If they are numeric the expression will always return null as the cases are not satisfiled.
The better way to debug is select one meter transaction where the condition is satisfied and check out what Only(Meter_Reading_Reason) and Only(Meter_Reading_Type) are returning. Accordingly change you expression.
I just tried exactly that myself, it pulls all of the accounts with data other than 01 or 02 for meter reading type or reason, if it helps I am trying to exclude meter reading type'03', I tried <>'03' in the set analysis but it didnt like it, is there a way to exlude specific data out of set analysis?
The goal of the exercise is to only load accounts where meter reading reason/type and to ingore the other accounts.