Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Condition to derive field

Hi ,

We are using the below logic to derive supplier detail based on some business condtions.

Previously for one unique supplierID we have more than one SupplierName so get the unique SupplierName we add supplier legacy code to the ID as below and finally we derive it.

But for some SupplierID's we do see blanks.But Individually if we check we have data ie', supplierName.

Is there any approach like this.

[Supplier_Detail]:

LOAD [Supplier ID],

IF(SupplierNum LIKE('H1*'), [Supplier ID] & '-12000', [Supplier ID] & '-13030' AS [Supplier ID1],

FirstValue(Supplier) as Supplier_Final

Resident Supplier

Group By [Supplier ID];

Please LMK if need mor info.

Thanks

7 Replies
Anil_Babu_Samineni

Why not, Perhaps this?

Pick(WildMatch(SupplierNum,'H1*'), [Supplier ID] & '-12000', [Supplier ID] & '-13030') AS [Supplier ID1]

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
nareshthavidishetty
Creator III
Creator III
Author

Hi,

Using  the bekow logic we are getting only Supplier ID's end with '_12000' only.

Pick(WildMatch(SupplierNum,'H1*'), [Supplier ID] & '-12000', [Supplier ID] & '-13030') AS [Supplier ID1]


We need to map '_13030' as well.

Thanks..

nareshthavidishetty
Creator III
Creator III
Author

Hi,

Here 'H1*' is map with  '_12000' and 'H2*' is map with '_13030'

Thanks..

avinashelite

Try this

IF(SupplierNum LIKE('H1*'), [Supplier ID] & '-12000', [Supplier ID] & '-13030') AS [Supplier ID1],


Do you have any other values other then H1 and H2...

Anil_Babu_Samineni

So, What you mean Mapping table in your contextual content?

Perhaps this? Same as other if needed

Pick(WildMatch(SupplierNum,'H1*', 'H2*'), [Supplier ID] & '-12000', [Supplier ID] & '-13030') AS [Supplier ID1]

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
nareshthavidishetty
Creator III
Creator III
Author

Hi ,

Both the logics were working fine but fro few supplier ID's Supplier names was blank.

If we pulled same fields individually we do have supplier name for those supllier Id's.

Logic1:IF(SupplierNum LIKE('H1*'), [Supplier ID] & '-12000', [Supplier ID] & '-13030') AS [Supplier ID1]

Logic2:Pick(WildMatch(SupplierNum,'H1*', 'H2*'), [Supplier ID] & '-12000', [Supplier ID] & '-13030') AS [Supplier ID1]


Thanks..

Anil_Babu_Samineni

You should reply to who you want to reply and person to understand better rather yours. Any way

Pick(WildMatch(SupplierNum,'H1*', 'H2*'), [Supplier ID] & '-12000', [Supplier ID] & '-13030', 'Null') AS [Supplier ID1]


Note - the reason behind we are checking with 2 numbers only. So, It will pick 2 mapping only. If you want you can use Blue one and instead you can write anything ..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful