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

How to write expressions to show current and following month values?

Hi,

I have columns as below and data I have added is sample data

Station                   Date                         ID

Posted                   12/05/2015                     9484290

Ready to post        30/06/2015               7431846314

Posted                   04/05/2015                      95645646

Ready to post        01/06/2015               7855678

Posted                  10/05/2015                    8767

Ready to post        10/06/2015               6356346

I need to write expression 1 to show Count(ID) which are Posted in current month and another  expression 2 to show Count(ID) which are Ready to post in following month.

so, the two expression should show values in further months as well.

for eg: if we are in June month expression 1 should show values which are Posted in June and expression 2 should show values which are Ready to Post in July month.

Please can anyone suggest me how to write the expressions

Thanks.

6 Replies
Not applicable
Author

I used below

Count(DISTINCT {<Flag={1},Station={'Posted'}>}ID)

mato32188
Specialist
Specialist

Hi Amelia,

in script create additional field Month(Date) as Month and then:

expression1: Count( {<Station = {'Posted'}, Month = {'$(=Month(Today())'}>} ID)

expression2: Count( {<Station = {'Ready to post'}, Month = {'$(=Month(Today())+1'}>} ID)

M

ECG line chart is the most important visualization in your life.
Not applicable
Author

Thanks. I have tried this and it I showing empty values.

do I need to change any thing in expressions.

nithin_miryala
Creator
Creator

Hi Amelia,

That should work as martin said.

Otherwise you can increment the month using AddMonths function

Not applicable
Author

Thanks. I tried below

Count(DISTINCT {<Flag={1},Path={'Banymoore'},Station={'Posted'},MonthYear={"=$(=Date(Addmonths(Max(MonthYear),0)))"}>}ID)

is this correct to calculate for current month?

for following month I have used below

Count(DISTINCT {<Flag={1},Path={'Banymoore'},Station={'Ready to Post'},MonthYear={"=$(=Date(Addmonths(Max(MonthYear),1)))"}>}ID)

is this correct to calculate for following month?

Please let me know.

nithin_miryala
Creator
Creator

Yes It should work