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: 
renuka_sasikumar
Creator III
Creator III

vMaxMonth variable is not working in Expression.

Hi,

When I use Count({$<MonthNumber={'$(vMaxMonth)'}>}Data) where my

vMaxMonth=Max({$<[Fiscal Year]={'$(=Max([Fiscal Year]))'}>}MonthNumber)

it's not working.

I know its very simple, but I think I am missing out something.

Can anyone help on this.

I want to show MaxMonth Data in a TextObject.

Regards,

Renuka S

1 Solution

Accepted Solutions
renuka_sasikumar
Creator III
Creator III
Author

Hi,

I got it, I used it as

vMaxMonth=Max({$<[Fiscal Year]={'$(=Max([Fiscal Year]))'}>}MonthNumber)


Expression :

Count({$<[Fiscal Year]={"$(=Max([Fiscal Year]))"},MonthNumber={$(vMaxMonth)}>}Data)



Regards,

Renuka S

View solution in original post

17 Replies
prat1507
Specialist
Specialist

Hi Renuka

Try replacing $(vMaxMonth) with vMaxMonth. I hope it might work.

Regards

Pratyush

renuka_sasikumar
Creator III
Creator III
Author

Thanks Pratyush for your prompt reply.

Do you mean to say like this

Count({$<MonthNumber={'(vMaxMonth)'}>}Data_Status)

If so, then also its not working.

Regards,

Renuka S

prat1507
Specialist
Specialist

Remove the brackets, just keep the variable name.

renuka_sasikumar
Creator III
Creator III
Author

No still not working.

Regards,

Renuka S

prat1507
Specialist
Specialist

Could you please share a sample app.

Regards

Pratyush

renuka_sasikumar
Creator III
Creator III
Author

Hi,

Due to some reason I won't be able to share the sample app.

Regards,

Renuka S

prat1507
Specialist
Specialist

Please find the attached app for your reference.

Regards

Pratyush

jonathandienst
Partner - Champion III
Partner - Champion III

I think you were very close. Try this:

=Count({$<MonthNumber = {"$(=$(vMaxMonth))"}>} Data)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

Or redefine the variable with a leading = sign:

=Max({$<[Fiscal Year]={'$(=Max([Fiscal Year]))'}>}MonthNumber)

Then use:

=Count({$<MonthNumber = {$(vMaxMonth)}>} Data)


This assumes that MonthNumber is a simple integer.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein