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

Get the MinString value based on 2 conditions using Set Analysis

Hi Experts,

I'm having this kind of table in my model:

EliGohar_0-1608022865936.png

I'm trying to create a KPI that presents the first Source value (according to ABC order) based on 2 conditions:

1. Max Date - in this table above it's 26/11/2020

2. Activity_Heat_Map_URL field should be populated with URL (Not null)

So for the example above I suppose to get the Kitchen source.

I tried the following expression but I get wrong result:

MinString({<[Activity_Heat_Map_URL]-={'-'},Date={"=$(=Date(Max(Date),'DD/MM/YYYY'))"}>}Capitalize(Source))

 

What am I doing wrong?

Eli.

Labels (2)
4 Replies
tresesco
MVP
MVP

@EliGohar 

It seems your null exclusion is not working here. Try like:

 

MinString({<[Activity_Heat_Map_URL]={'*'},Date={"=$(=Date(Max(Date),'DD/MM/YYYY'))"}>}Capitalize(Source))

 

Including '*' means 'all values except nulls'

EliGohar
Partner - Creator III
Partner - Creator III
Author

@tresesco I tried your suggestion, it gives me null result:

EliGohar_0-1608025079130.png

 

tresesco
MVP
MVP

@EliGohar ..Ohh

Try with this small correction in quotes; use double quotes instead, also try removing '=' from date before '$', like:

 

MinString({<[Activity_Heat_Map_URL]={"*"},Date={"$(=Date(Max(Date),'DD/MM/YYYY'))"}>}Capitalize(Source))

 

EliGohar
Partner - Creator III
Partner - Creator III
Author

@tresesco I thought your expression worked but then I updated the table to be:

EliGohar_0-1608029069460.png

Your expression:

 

 

MinString({<[Activity_Heat_Map_URL]={"*"},Date={"$(=Date(Max(Date),'DD/MM/YYYY'))"}>}Capitalize(Source))

 

Returns Null in the KPI value. I'm expecting to get Kitchen.

BTW to find the max date that has the URL I'm using:

 

 max({<Date={"=$(=Date(Max(Date),'DD/MM/YYYY'))"}, [Activity_Heat_Map_URL]-={"-"}>}date(Date,VDate))

 

And I get the correct date (26/11/20)

Any idea why?