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

Issues with MinString and Strings with lower/upper cases

Hi all,

Using the following expression I'm trying to get the first source (ABC order) with the maximum date (with a URL that is not null):

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

This is the list of sources I have

image.png

What I get in that case is Camera1112, which is not the min string. I suppose to get airport1 source.

I guess it's something to do with Upper and lower cases.

Can you advise me how to overcome this issue?

Thanks 🙂

 

 

1 Solution

Accepted Solutions
sunny_talwar

Not entirely sure if this helps in anyway... but I created a sample dashboard where I loaded 4 rows that you have showed in the image above

image.png

And using the expression that we used before...

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

I got this

image.png

Now, if it works for me, I am not sure what you have differently which makes it not work for you, but one thing which is sort of the ordinary is that you load you say that you load your date as DD/MM/YYYY, but display it as MM/DD/YY? I mean this is not too bad, but when it comes to set analysis... things tend to get complicated with the date formats. Set analysis requires you to have the same date format as it was loaded, else it won't work. Are you 100% confident that you load the date as DD/MM/YYYY? One way to change this to load your date like this

Date(Floor(DateField)) as Date

and now just use this

MinString({<Date = {"$(=Date(Max(Date)))"}, [Common_Path_URL]-={"-"}>} Capitalize(Source))  

 

View solution in original post

22 Replies
sunny_talwar

One option is to use this

MinString({<Date={"<=$(=Date(Max(Date),'DD/MM/YYYY'))"}, [Dwell_Heat_Map_URL]-={"-"}>} Capitalize(Source))
EliGohar
Partner - Creator III
Partner - Creator III
Author

Hi @sunny_talwar 

Tried this , and also Upper() or Lower().

This options ignore the conditions i set in the set analysis for some reason.

It's bringing me the First Source in ABC order, but that source doesn't have the max date.

Here's a screenshot:

image.png

Maybe you can think about another solution?

Thanks!

sunny_talwar

This is an issue with the set analysis on Date... is your date formatted as DD/MM/YY or DD/MM/YYYY? If it is DD/MM/YY, try this

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

 

EliGohar
Partner - Creator III
Partner - Creator III
Author

Not working 😞
the date is DD/MM/YYYY
sunny_talwar

Are you changing the format from the Number's tab here?

image.png

Can you check the default format by creating a list box for Date field without any functions

EliGohar
Partner - Creator III
Partner - Creator III
Author

Original format is DD/MM/YY

When i'm using this expression it gives me the maximum date:

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

but again, i get the wrong source name 😞

image.png

I still suspect that using the Capitalize function ignores the set analysis rules.

sunny_talwar

Oh, I see what is going on... you need this on the Max Date.... Try this

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

Basically, you were looking at MinString on all Dates less than the max date, but it seems you need the MinString on the Max Date itself. Is that right?

EliGohar
Partner - Creator III
Partner - Creator III
Author


@sunny_talwar wrote:

Oh, I see what is going on... you need this on the Max Date.... Try this

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

Basically, you were looking at MinString on all Dates less than the max date, but it seems you need the MinString on the Max Date itself. Is that right?


Yes, That's exactly what I intended to achieve.

However, the correction you posted isn't bringing any result.

sunny_talwar

Would you be able to share a sample of your app to show the issue?