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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
kumarkp412
Creator II
Creator II

minimum value form a field

Hi all,

I am having problem  to calculate the minimum value of the field .For a particular date and Ref id i want to take the minimum to display it to all other rows.

My table  is

Date Ref ididRank
9/30201311002
9/30201312123

9/302013

12253
10/2/201314004

my resultant table:

DateRef ididRank
9/30/201311002
9/30/201312122
9/30/201312252
10/2/201314004

here , i need to calculate the minimum rank based on date and Ref id  but i am not able to calculate .

can any one give me the  solution to this.

Thank in Advance

Regards

Kumar

9 Replies
morganaaron
Specialist
Specialist

Min(Total<Date, [Ref id]> Rank) should do it.

PrashantSangle

Hi,

look at firstsortedvalue()

Is it based on Date and Ref id or id???

because in above example Date and Ref Id are same for 1 st 3 id

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
kumarkp412
Creator II
Creator II
Author

Hi Aaron Morgan ,

Thanks for reply , But i want to use this in the script side

Can you give any example of this

Regards

Kumar

kumarkp412
Creator II
Creator II
Author

HI Max,

It is based on the Date

Regards

morganaaron
Specialist
Specialist

Just create a resident load like:

Join([Your Table])
Load
Date,
Min(Rank) as MinRank
Resident [Your table]

Group by Date;

kumarkp412
Creator II
Creator II
Author

But , when i am using this i may get the minimum value of the rank and it is assign to all the other.

for example if it have  rank values  1,2,3,4,5 and it will give the minimum of these and it is displaying .

I didnt want to show least minimum to all other , i want to take the minimum rank in a particular day(i.e 2,4,5 then i want to show 2 to all others)

Regards

kumar

morganaaron
Specialist
Specialist

Using the above method I got exactly what you wanted from your output table - it attaches it to the date only (you can include ref id as a group by, but in response to another question you said you only want it by date) therefore will show the minimum value for the date - there is no id attached unless you put that in the resident load.

See attached - I haven't bothered adding an aggregation to MinRank because you've already done it in the script. If I've misunderstood your requirement please be clearer or show a better example result table

CELAMBARASAN
Partner - Champion
Partner - Champion


Join([Your Table])
Load
Date,

[Ref id],
Min(Rank) as MinRank
Resident [Your table]

Group by Date, [Ref id];

kumarkp412
Creator II
Creator II
Author

Thanks  Aaron ,

It  was helped me a lot .

Regards

Kumar