Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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

17 Replies
Anonymous
Not applicable

Hi

      Use '=' in variable Created time .

      Ex: variable Name : vCurrentYear

           =Year(today)

After vCurrentYear variable use : $(vCurrentYear)

renuka_sasikumar
Creator III
Creator III
Author

Thanks,

I tried this, but it gives me wrong Count.

Regards,

Renuka S

prat1507
Specialist
Specialist

Did you check my .qvw file?

Regards

Pratyush

jonathandienst
Partner - Champion III
Partner - Champion III

Then something else is going on. I suggest that you upload a small sample that illustrates the issue (and which does not need contain any sensitive data). Include the expressions you have tried and specify what result(s) you expect.

To upload a qvf file, click 'Use advanced editor'. You can upload a qvf from there,

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

Hello Renuka,

If you the DateKey as date field then you can make use of below given expression:

=Count({$<MonthNumber = {"=$(=Num(Month(Max(DateKey))))"}>} Data)

Regards!

Rahul

renuka_sasikumar
Creator III
Creator III
Author

I don't have QlikView installed.

prat1507
Specialist
Specialist

Just try and declare a separate variable for =Max([Fiscal Year]) and use it instead of the function, I did the same and it worked out in qlikview.

Regards

Pratyush

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