Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mhmmd_srf
Contributor II

Need to Show data after Aug-2016

Hi All,

I have below requirements. I need to show no if inc count which came after Aug-2016 with other certain condition. Below is my expression:

Count({$<[Incident_Month_Year]={'>=2016-Aug'},inc_flag={'Closed'},inc_priority={'1'}>} distinct inc_number)

But in this case the KPI is static. Value is not changing with the selection of months. It is always showing 145.

Please suggest.

Thanks,
Sarif

16 Replies
sushil353
Honored Contributor II

Re: Need to Show data after Aug-2016

Try this:

Count({$<[Incident_Month_Year]={">=2016-Aug"},inc_flag={'Closed'},inc_priority={'1'}>} distinct inc_number)


assuming the [Incident_Month_Year] have the same format as 2016-Aug..


if not then try this:

Count({$<[Incident_Month_Year]={">=$(=Date(Date#('2016-Aug','YYYY-MMM')))"},inc_flag={'Closed'},inc_priority={'1'}>} distinct inc_number)



mhmmd_srf
Contributor II

Re: Need to Show data after Aug-2016

yea.. both are in same format..that is why it is returning value..but your expression is always showing 0.

Please help

krishna20
Valued Contributor II

Re: Need to Show data after Aug-2016

use below expression


please by pass the Incident_Month_Year in expression


Count({$<[Incident_Month_Year]={">=2016-Aug"},inc_flag={'Closed'},inc_priority={'1'},Incident_Month_Year=>} distinct inc_number)


mhmmd_srf
Contributor II

Re: Need to Show data after Aug-2016

Hi Kalyan,

No sir..it is showing result for all period. And not changing value with selection of Year-Month.

Please help.

Sarif

teiswamsler
Contributor II

Re: Need to Show data after Aug-2016

Hi Mohammed

When selecting Aug, following expression will Count from Aug and forward.

Count( distinct  {<

[FieldYouAreMakingDateSelectionsIn]=,

[Datefield] = {">=$(= Monthstart( Max( [Datefield] ) )"},

inc_flag={'Closed'},

inc_priority={'1'}

>} inc_number )

/Teis

dimitar_angelov
New Contributor II

Re: Need to Show data after Aug-2016

Right off the bat I can tell you set expressions are considered as "filters" before the layot filters. Means they overrun layout selections. In your expression everything is hard coded and the data is always shown for the available moths after Aug. And your layot selections on Month will not affect the result. You need to rework this according to your logic. Your KPI is static regarding months with this expression.

If you explain what you need to see (you said data after Aug, and it should be showing it) I might be able to help.

mhmmd_srf
Contributor II

Re: Need to Show data after Aug-2016

not working sir

teiswamsler
Contributor II

Re: Need to Show data after Aug-2016

Hi Mohammed

Can you shared a sample app?

/Teis

MVP
MVP

Re: Need to Show data after Aug-2016

First check has to be done - if your field [Incident_Month_Year] type is string or a proper date. If it has string type data , your expression would not work the way you want. You have to create it in the script using date(), something like:

Load

          Date( DateField, 'YYYY-MMM') as [Incident_Month_Year]


Rather than a string calc like:


Load

           Year&'-'&Month as [Incident_Month_Year]   // This is NOT recommended