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

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

Weired behaviour with SQL script in script editor

Hi

Previously in my dashboard, I used the below script

Score:

SQL select s.simulation_id,

    s.phase_id,

    s.reviewee as user_id,

           us.name,

    s.sim_action_id,

    sa.title as Action_name,

    s.reviewer,

    s.score_option_id,

    so.value

  from score s,score_option so,sim_action sa,user us where

  s.score_option_id = so.score_option_id

  and s.sim_action_id = sa.sim_action_id

        and s.reviewee=us.user_id and s.score_option_id NOT IN (8,7);

But now based on requirement I just added another condition to my where clause in the above query, which looks like as below

select s.simulation_id,

    s.phase_id,

    s.reviewee as user_id,

           us.name,

    s.sim_action_id,

    sa.title as Action_name,

    s.reviewer,

    s.score_option_id,

    so.value

  from score s,score_option so,sim_action sa,user us where

  s.score_option_id = so.score_option_id

  and s.sim_action_id = sa.sim_action_id

        and s.reviewee=us.user_id and s.score_option_id NOT IN (8,7)

        and s.reviewer <> 1;

and removed the first query, I reloaded the script but it is sill giving the same result as first one (including reviewer id  = 1).

MySQL is returning the perfect data when I execute the query in MySQL.

Can someone explain why this is happening? What is the solution for this one.

Thanks

3 Replies
lironbaram
Partner - Master III
Partner - Master III

hi

are you sure there isn't other table you load the userid 1

if you load the query in a new model as a lone table , those it work properly?

Not applicable
Author

I am not getting your point exactly.

But I figured it out, the problem is, if two tables have same column names, then qlikview is not concentrating on any conditions which I mentioned in where clause, it is just giving the same result for those 2 tables. Do you encounter any of these type of problems ?

Anil_Babu_Samineni

Try with this from load statement

Load * from source

Where s.reviewer <> 1;

SQL

select s.simulation_id,

    s.phase_id,

    s.reviewee as user_id,

           us.name,

    s.sim_action_id,

    sa.title as Action_name,

    s.reviewer,

    s.score_option_id,

    so.value

  from score s,score_option so,sim_action sa,user us where

  s.score_option_id = so.score_option_id

  and s.sim_action_id = sa.sim_action_id

        and s.reviewee=us.user_id and s.score_option_id NOT IN (8,7);

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