Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two fields of IDs : IDA and IDB I want to compare in a chart. If value of IDA appears in IDB, then mark it valid. The chart should look like this. I think there should be an expression I can write for the "Valid" column, can someone help with that?
Thanks
IDA | Valid |
251243 | Yes |
12613 | NO |
1543 | Yes |
Can you send the IDB values?
For example:
251243,
12612,
1543
Try this
FieldsTmp:
LOAD * INLINE [
IDA, IDB
251243, 1543
12613, 251243
1543, 12612
];
ToCompare:
LOAD IDB as CompareTo
RESIDENT FieldsTmp;
NOCONCATENATE
Comp:
LOAD IDA,
IDB,
if(Exists(CompareTo, IDA), 'Yes', 'No') as Valid
RESIDENT FieldsTmp;
DROP Table FieldsTmp, ToCompare;
Anyway this can be done in the chart instead in the load script? I was trying to avoid using load script because there are a lot of fields I'm trying to compare. I feel an expresison in the chart will be easier.
thanks
If the columns IDA and IDB are like
IDA | IDB |
---|---|
12345 | 12345 |
1262 | 1263 |
3425 | 3425 |
Then the Valid Column shoud be something like
=f([IDA]=[IDB], 'Yes', 'No')
Actually, IDA and IDB are fields from two differnet tables. How should the expression be modified?
Thanks
Create calculated dimesion
=aggr(if(trim(lower(IDA))=trim(lower(IDB)),'Valid','Invalid'), Dimension)
or Expression
if(trim(lower(IDA))=trim(lower(IDB)),'Valid','Invalid')