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: 
tulasiram_bitra
Creator
Creator

How to Consider Maximum Date in Each Month as Dimension ?

Hi Frnz,

I would like to show monthly wise  count({$<Aging_Category={'0-30'}>}Aging_Category).

but here i have to consider maximum date in each month. i.e.,

Jan - 31st [ Depends on my data ]

Feb - 28th

------

Please help me to write expression for that.

Here Dimension  ==> Month

        Expression  ==> count({$<Aging_Category={'0-30'}>}Aging_Category)

22 Replies
tulasiram_bitra
Creator
Creator
Author

Hi Balraj,

Thanks for your reply. Here I need to show in Monthly wise. Month as my dimension, but it has to consider only last date of that month. In some other KPIs also, i have used Month as Dimension. In this KPI only i need to consider last date of that month. Any solution Plz ..

tulasiram_bitra
Creator
Creator
Author

Hi Frnz,

Please find the below attached qvw for your reference.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Handling this in script with a flag is the best option like below

Data:

LOAD

*,

If(Day(MonthEnd(DateFieldName)) = Day(DateFieldName), 1, 0) AS MonthEndFlag

FROM DataSource;

Now in your expression just use

Dimension = Month

Expression= count({$<Aging_Category={'0-30'}, MonthEndFlag={1}>}Aging_Category)

Hope this helps you.

Regards,

jagan.

Anonymous
Not applicable

You may also replace your Dim with a calculated Dimension like?

Dim: =aggr(max(Date), Month(Date))

Expression: count({$<Aging_Category={'0-30'}>}Aging_Category)

tulasiram_bitra
Creator
Creator
Author

Hi,

It is not working.

tulasiram_bitra
Creator
Creator
Author

Hi,

Here we need to consider Maximum Date and not last date of that month.

tresesco
MVP
MVP

count({$<Aging_Category={'0-30'}>} Aggr(If(Date=Max(Date), Month), Aging_Category))

Edit: Corrected

tulasiram_bitra
Creator
Creator
Author

Hi,

getting "no data to display". Please consider my qvw which was attched above.

sunny_talwar

You have an extra >} before Aggr. Try removing that and see what happens.

tresesco
MVP
MVP

I am getting it like:

Untitled.png