Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need Expression in straight table


Hello Every one,

Please give me solution for the below query. I need a expression in straight table.

Concept :- In my application, we have four depots (S1,S2,S3,S4). In all depots same part no available (Eg:- "A"). But Supplier code's will be differ. For S1 depot, XYZ is the supplier code. But for remaining depots (S2,S3,S4) -- > S1 is the supplier code.

Now, I need to create a straight table , where I need to show the base supplier code. Hope you ppl understand my query. Please provide solution asap. Thanks in advance.

Sample data :-

Exp.jpg

9 Replies
vikasmahajan

attach sample qvw

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
kiranmanoharrode
Creator III
Creator III

try  Below expression

=Only(SUPPLIER CODE)

Regards

Kiran

ashwanin
Specialist
Specialist

Its a tricky one if you have only two supplier. ie s1 and XYZ. But if you have multiple supplier, then have to think in different way.

amit_saini
Master III
Master III

Hi Reenaabraham,

Write this in expression for calculating Supplier:

if(Supplier,'S1','XYZ')

Thanks,

sudeepkm
Specialist III
Specialist III

I've a solution that can work for multiple DEPOT and Supplier data.

1. I've created a sample data like below.

dptsupp.png

2. Objective is to create another field in the script as NEWSUPP which will have values like below

dptsupp1.png

3. This is how you can do it at script level.

dptmap:

Mapping LOAD

DEPOT,SUPPLIER

FROM

dEPOTsUPPLIER.xlsx (ooxml, embedded labels, table is Sheet1);

dpt:

LOAD DEPOT,

    PART,

    SUPPLIER,

    ApplyMap('dptmap',SUPPLIER,SUPPLIER) as NWSUPP

FROM

dEPOTsUPPLIER.xlsx (ooxml, embedded labels, table is Sheet1);

4. In the UI your straight table may use the new field NWSUPP.

Attached xls and QVW are for reference.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

At the moment everyone is pretty much guessing.

You need to explain how to select the "base" supplier code. Is it always depot S1, or the first instance in the file or some other method?

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hello Every one,

Sorry for late response.

In my case, I have 50 k parts with different supplier code's. Base supplier is S1 only in all case's.

Please find my requirement below.  Please let me know the solution for same. Thanks in advance.

Supplier.jpg

Not applicable
Author

Hello,

If there is only 1 part then your solution is fine. But in my case, I have many parts. Please find my reply for the requirement. Thank you.

sudeepkm
Specialist III
Specialist III

you may try the composite key that means considering DEPOT and PART as a single field.

Please find the attached QVW. Given below is how it looks in QlikView.

dptsupp2.png