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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
rkpatelqlikview
Creator III
Creator III

Convert to SQL min query to Qlik script

Hi Team,

Here the script in SQL ,I want to write the same in Qlik. How can i convert the Min,this Min with in the table. I did but giving some wrong result.

    SELECT DISTINCT  DATE
    FROM  historyData
    WHERE  type = 'SR'
    AND  CODE        = 'APPROVE'
    AND   History_ID          =  Tran.Tran_ID
    AND 
   SEQ_Num      =
      (SELECT min(SEQ_Num )
      FROM historyData
      WHERE  type = 'SR'
    AND  CODE        = 'APPROVE'
      AND History_ID          =  Tran.Tran_ID
      )
    ) History_DATE
 
 
I converted to Qlik as below but giving some wrong result.
 
Inner Join(Tran)
LOAD
History_ID          AS Key_History_ID ,
min(SEQ_Num ) AS  Seq_Num,
Date(Floor(DATE)) as History_Date
FROM [...._history.qvd] (qvd)
WHERE TYPE='PO' and CODE='APPROVE'
Group BY   History_ID ,  CODE, DATE;
 
Thanks in Advance. 

 

Labels (1)
0 Replies