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: 
Not applicable

variable problem

Hi,

how can i add a variable like "month(today())" to month in below set analysis. thanks

Sum({<year={2013},month={May},day={2}>}TRA_QTY)

1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

You can create different field like

Load

Month(TRA_DATE) as Month

Num(Month(TRA_DATE)) as NumMonth


From Location;


And use NumMonth field in SET analysis expression.


View solution in original post

30 Replies
its_anandrjs
Champion III
Champion III

Try with

Sum({<year={2013},month={' $ (=Month(Today()) ) '},day={2}>}TRA_QTY)

Or

Sum({<year={2013},month={" $ (=Month(Today()) ) "},day={2}>}TRA_QTY)

MK_QSL
MVP
MVP

SUM({<year = {'$(=Year(Today()))'}, month = {'$(=Month(Today()))'}>}TRA_QTY)

SUM({<year = {'$(=Year(Today())-1)'}, month = {'$(=Month(Today())-1)'}>}TRA_QTY)


Not applicable
Author

Dont you only use " when its a search string? When it should be between two months or so?

ashfaq_haseeb
Champion III
Champion III

Try below

Sum({<year={"$(=year(today()))"},month={"$(=Month(today()))"},day={"$(=day(today()))">}TRA_QTY)


Regards

ASHFAQ

Not applicable
Author

thanks anand, I have another problem how can i get previous month?

ashfaq_haseeb
Champion III
Champion III

H try below

Sum({<year={2013},month={' $ (=Month(Today())-1 ) '},day={2}>}TRA_QTY)


Regards

ASHFAQ

its_anandrjs
Champion III
Champion III

Try with

Sum({<year={2013},month={' $ (=Month(Today())-1 ) '},day={2}>}TRA_QTY)

Not applicable
Author

Hi Anand,

my variable name is currentMonth. How can i include it?

currentMonth=month(today())

Not applicable
Author

i guess its a string?

Sum({<year={2013},month={ '$(currentMonth)' '},day={2}>}TRA_QTY)