Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

prabunakil
New Contributor III

To show the latest Month expression

Hi, i have a table to show the net sales.

the table include of field name, transactionmonth1, net sales.

What is the expression in the straight table i can set to show the net sales always show in current month (Latest Month).


eg: now is August, the net sales showing is aug sales. next month is sept, net sales show is september.


Please advise. 

11 Replies
sibin_jacob
Contributor III

Re: To show the latest Month expression

Write the transactionmonth1 dimension like below

if(transactionmonth1= Date(max(Date#(transactionmonth1,'MMM')),'MMM'),transactionmonth1)

Then Check on the suppress when value is null.

I am assuming the transactionmonth1 value formats are Jan,Feb, Mar etc


Partner
Partner

Re: To show the latest Month expression

Try,

sum({<transactionmonth1 = {"$(=max(transactionmonth1))"}>} [Net Sales])

arvind1494
Valued Contributor

Re: To show the latest Month expression

Hi Prabu

Check the attached qvf

prabunakil
New Contributor III

Re: To show the latest Month expression

Can i have it in qvw file?

prabunakil
New Contributor III

Re: To show the latest Month expression

Hi it Did not work

Partner
Partner

Re: To show the latest Month expression

Hi Prabu,

Check if transactionmonth1 is a numeric field or text field.


If it is a numeric field, shraddha.g solution should work.

Drag a filter panel out and insert transactionmonth1 into the filter panel.


Then check if the months in transactionmonth1 is left-aligned or right-aligned.


Thanks and regards,

Arthur Fong

Highlighted
sibin_jacob
Contributor III

Re: To show the latest Month expression

As Arvind Suggested,

Use the dimension as

=Month(Today())

and expression

=sum({<transactionmonth1 ={$(=Month(Today()))}>}[net sales])

balabhaskarqlik
Honored Contributor

Re: To show the latest Month expression

May be this:

=sum({$<transactionmonth1 = {"=$(=Month(Today()))"}>}NetSales)

Or

=SUM({$<transactionmonth1={'$(=max(vCurrMonth))'}>}NetSales)

LET vCurrMonth = month(transactionmonth1);

prabunakil
New Contributor III

Re: To show the latest Month expression

is a numeric field