Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

show currently opened records for last 4 months

Hi,

I have data in this format:

Problem ticketOpen DateClose DateStatus
11/14/2015Open
22/13/2016Open
35/19/2016Open
43/29/20175/22/2017Close
56/8/2017Open

I want to display currently opened records month wise in a bar chart in such a way that it only displays data of last 4 months including current month.

So the output should be like:

MonthProblem ticket
Apr4
May3
Jun4
Jul4

thanks in advance

5 Replies
mangalsk
Creator III
Creator III

You just need to create flag as if (status='Open','Open','Close')  as flag_status and in expression can write like

count({<flag_status={'Open'}>}distinct Problem_ticket)

pathiqvd
Creator III
Creator III

Hi,

   Try like this,

count({<status={"Open"},Opendate={">=$(=monthstart(addmonths(max(opendate),-4)))<=$(=max(opendate))"}>}fieldname)

Regards,

venkat_dabbakut
Partner - Contributor
Partner - Contributor

Hi ,

try this

count({<status={"Open"},Opendate={">=$(=monthstart(addmonths(max(opendate),-4)))<=$(=max(opendate))"}>}fieldname)

PrashantSangle

create Master Calendar which will contain all month

then using interval match() with master calendar replicate the ticket is open for the respected month.

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
neha_shirsath
Specialist
Specialist

Hi Sahil,

You can also create bucket as per days you filter out like -

difference between open date and close date and create bucket for the same in script

if([Open Date]-[Close Date]>=0 and [Open Date]-[Close Date]<=120,'0-120',

    if([Open Date]- [Close Date]>120 ,'>120'))))  as test

then

add in expression in chart -

Count({<flag_status={'Open'}, test={'0-120'}>}distinct Problem_ticket)