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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
md_qlikview
Creator II
Creator II

Need Help In DataModel

Hello all,

I have written multiple if statements at the script level and based on the condition i am trying to load some fields from a table in each if.

If condition is written in such a way that every time only one of the if will get executed based on the base data.

Upto this i am getting what is required. After this, after EndIf statement i am trying to do join to that table, by another table but it is not actually working and new fields from joining other table is not getting added.

Can anybody help???

Thanks In Advance

7 Replies
Anonymous
Not applicable

give a script extract.

marcus_sommer

You need to provide more details.

- Marcus

md_qlikview
Creator II
Creator II
Author

Dummy Example -

If Sales > $200 then

Load CustomerId, Sales

From Customer;

else

If Sales >$100  then

Load CustomerId, Sales, Country

From Customer;

End If

Left Join

CustomerId, CustomerName, Address

From Contact;

md_qlikview
Creator II
Creator II
Author

In this case i will not get fields from contacts like CustomerName, Address.

marcus_sommer

You compares Sales (is this really a variable ?) against $200 which is no number, no string and no variables - I think you need only the value 200. Also you need to check (maybe per TRACE) which value Sales had - from where did it come. Further your if-loop won't cover each case whereby the join-statement could fail.

- Marcus

md_qlikview
Creator II
Creator II
Author

This was just a dummy example. In my actual example field which i am comparing is a variable only and Its an integer.

I am checking that variable value with integer only say 5, 4, 3 etc according to my condition.

Suppose i am having 5 such conditions, so my 3rd  conditon is coming as true and i am getting those fields which are there in the table. Further i am doing few join operations to that table which is satisfying the if condition.

But all those fields from those join operations not getting added to my original table

marcus_sommer

I suggest you comment your loadings out and adds trace-statements with your variables to see what happens - on which point had which variable which value. You could see that tracing within the log-file or within the processing-window. As alternatively you could use the debugger and goes step-wise through your script.

- Marcus