Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
janturon
Contributor III
Contributor III

Bad format of Month saved in variable

Hi,

I need help with variable.

I have Field Month with values in format like this:

Month

01

02

03

I have defined variable:

vmaxmonth=Max(Month)

But result of vmaxmonth in set analysis or text object is not 03, but 3.

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

This depends on what data format you have in Month field.

If it is a Text then you should use the Maxstring instead of Max function.

If it is a numeric value you should use num(Max(Month),'00')

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

This depends on what data format you have in Month field.

If it is a Text then you should use the Maxstring instead of Max function.

If it is a numeric value you should use num(Max(Month),'00')

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
janturon
Contributor III
Contributor III
Author

This is right: num(Max(Month),'00')

Where can I see format of Fields?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

The Easy option is, add the filter on sheet and observe the data, if it is on left side it is text else it is number.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!