Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

fredericvillemi
Contributor 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
Highlighted
fredericvillemi
Contributor III

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

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
Highlighted

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

Hi,

use Date(MY_STR_MONTH,'YYYY/MM')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Highlighted

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

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

Highlighted
fredericvillemi
Contributor III

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

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