Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
prabunakil
Contributor III
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
Creator III
Creator III

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


shraddha_g
Partner - Master III
Partner - Master III

Try,

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

arvind1494
Specialist
Specialist

Hi Prabu

Check the attached qvf

prabunakil
Contributor III
Contributor III
Author

Can i have it in qvw file?

prabunakil
Contributor III
Contributor III
Author

Hi it Did not work

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

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

sibin_jacob
Creator III
Creator III

As Arvind Suggested,

Use the dimension as

=Month(Today())

and expression

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

balabhaskarqlik

May be this:

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

Or

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

LET vCurrMonth = month(transactionmonth1);

prabunakil
Contributor III
Contributor III
Author

is a numeric field