Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
risabhroy_03
Partner - Creator II
Partner - Creator II

Find minimum for each record

I have to find minimum [Task No] for records based on "T$PITM" , "T$BPID", "T$TANO" , Company_Code.

My code is working fine for maximum but it is not working as expected for Minimum.

Below is my code for Maximum - 

[Max_SEQN]:
Mapping
Load
"T$PITM" & '|' & "T$BPID" & '|' & "T$TANO" & '|' & Company_Code,
max("T$SEQN") as [Max_SEQN_Updated]
FROM [$(vSource)\TTIUIL160.qvd](qvd)
Group By
Company_Code,
"T$PITM",
"T$BPID",
"T$TANO";

And I am using the below inside my table - 


if(ApplyMap('Min_SEQN',"T$PITM" & '|' & "T$BPID" & '|' & "T$TANO" & '|' & Company_Code,'-') = floor(num("T$SEQN")),1,0 ) as [Max_SEQN_Flag],

And I am using this like - 

where [Max_SEQN_Flag]=1;

It works perfect.

Please help me to the same with Minimum, I replaced Max with Min but it is not coming correct.

Labels (1)
1 Reply
MartW
Partner - Specialist
Partner - Specialist

did you change al the Max values to min, if so could you please als add the updated scripts