Discussion Board for collaboration on QlikView Scripting.
I have a problem Like this:
I have a date field which has all the update date and I have to take the Minimum Date from this field in the granular level.
And i have a status field that has all the Status Code.
Also another field "Processed" that has Boolean value T and F
Now i have to make a field "Active date" in the script based on these three fields.
Logic i am trying use is,
IF(Match([Status],'A','P') and [Processed]='F' and [Update Date]=Min([Update Date]), [Update Date], ' ') as [Active Date]
Seems like my logic is set on the Minimum Date from the Update date not the minimum date from the item/granular level for every products.
How do i write down the code in the script that can work in the Item level? Meaning, getting the minimum date for every product.
Go to Solution.
You can add to your table a min update date, using a group by and left join (bold)
left join (yourtable)
min(updatedate) as minupdatedate
group by product; // I think you want the min date by product
then you can do a resident table with an if condition on status, processed, updatedate, minupdatedate to calculate the activedate field
Perhaps like this:
Min([Update Date]) as [Active Date]
Match(Status, 'A','P') and Processed = 'F'
With the Where clause, Am i not limiting my table with the Match(Status, 'A','P') and Processed = 'F' filter?But my goal is to keep all the data and make a new filed Active date.
Something like that
I know this piece of code is wrong but the idea is like that.