Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 2 fields [Company_Code] and [BOLA].
I have to create a flag based on the below condition -
If [Company_Code]>300 and [BOLA] should not be blank then 0 else 1.
I wrote this but I don't know how to add the companycode>300 condition.
If(Len(trim("T$BOLA")) = 0,1,0) as [Bola_Flag]
If(Len(trim("T$BOLA")) = 0 and companycode>300,1,0) as [Bola_Flag]
It doesn't works
My BOLA is blank and company_Code>300 it should show as 1 only.
I have 2 fields [Company_Code] and [BOLA].
I have to create a flag based on the below condition -
If [Company_Code]>300 and [BOLA] should not be blank then 0 else 1.
I wrote this
if(Company_Code>300, If(Len(trim("T$BOLA"))= 0,1,0)
,0) as [Bola_Flag]
but not working as expected
That's a dimension. You should be using a measure (or creating your flag in your script).
If you created it in your script, it should work correctly.
Didn’t get you
Can you plz explain
The code works. If it's not working for you, either your data isn't what you think it is, or you're trying to do this using a calculated dimension.
Load *, if(Company_Code > 300 AND Len(trim("T$BOLA")) = 0,1,0) as Bola_Flag INLINE [
Company_Code, T$BOLA
310,
315,
320,
330,
];
Since you're getting two rows for each company code, there may be an issue with your data structure or you may have created the Bola_Flag field outside the context of the table which contains the actual value.
What did you get instead?
Given which values of Company_Code and BOLA?
Is "T$BOLA" supposed to be the same as BOLA?