Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
fredericvillemi
Creator III
Creator III

How to handle variable with string in format 2015/01 ?

Hello,

i have an issue with variables.

I have a string in which i'm using month formatted like that "yyyy/mm"  for example 2014/12

I want to use this set analysis : =sum({<MY_STR_MONTH={$(=maxString(MY_STR_MONTH))}>} value)

to get the sum only for the max month.

But it doesn't work because the $(=MaxString(MY_STR_MONTH)) convert this and the result is  167,8333

How can i do to use the max of a string field in which there is a "/" in a set analysis ?

Thanks

1 Solution

Accepted Solutions
fredericvillemi
Creator III
Creator III
Author

Oh sorry i have found the good answer in another thread.

sum({<MY_STR_MONTH={'$(=MaxString(MY_STR_MONTH))'}>} VALUE)


I think it's the best answer because i don't have to convert in Date nor to change my loader.

But yes, both other answers were interesting.

Thanks

View solution in original post

3 Replies
PrashantSangle

Hi,

use Date(MY_STR_MONTH,'YYYY/MM')

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 🙂
alexandros17
Partner - Champion III
Partner - Champion III

During loading of your data add another field formatted as YYYYMM and use this for your expressions

fredericvillemi
Creator III
Creator III
Author

Oh sorry i have found the good answer in another thread.

sum({<MY_STR_MONTH={'$(=MaxString(MY_STR_MONTH))'}>} VALUE)


I think it's the best answer because i don't have to convert in Date nor to change my loader.

But yes, both other answers were interesting.

Thanks