Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mhmmd_srf
Contributor II

Not Getting Fixed Value

Hi All,

I have an expression like:

Count({$<[Month_Year_Opened]={'2016-Sep'}>} distinct Req_number)

I want to make it fixed for 2016-Sep always. Even if I select any value from Month_Year_Opened filter. But this is not happening.

If I select any other value from filter like June-2016, the expression is showing 0. Hard coding is also not working. Any way to fix this?

Thanks,

Sarif

1 Solution

Accepted Solutions
vinieme12
Esteemed Contributor II

Re: Not Getting Fixed Value

Try

Count({$<[Month_Year_Opened],[Month_Year_Opened]={'2016-Sep'}>} distinct Req_number)

8 Replies
MVP
MVP

Re: Not Getting Fixed Value

You have to ensure that the date format of your field matches in the set expression. I.e. - if the field  [Month_Year_Opened] has data in YYYY-MMM format or MMM-YYYY. Whichever is correct, you have to pass the value in the set expression exactly in similar format. If you have any other date field and you wish to select a date from there, you have to bypass it's filter in the set expression as well like:

Count({$<OtherDate1, OtherDate2, [Month_Year_Opened]={'Sep-2016'}>} distinct Req_number)

mhmmd_srf
Contributor II

Re: Not Getting Fixed Value

Format is same. That is why default is showing. But when I am selecting any value from Month_Year_Opened filter then it is showing 0

Thanks,

Sarif

MVP
MVP

Re: Not Getting Fixed Value

Could you post a sample qvw that demonstrates the issue?

vinieme12
Esteemed Contributor II

Re: Not Getting Fixed Value

Try

Count({$<[Month_Year_Opened],[Month_Year_Opened]={'2016-Sep'}>} distinct Req_number)

MVP
MVP

Re: Not Getting Fixed Value

This is actually equivalent to: Count({$<[Month_Year_Opened]={'2016-Sep'}>} distinct Req_number) . I am not really sure if putting the same field twice in set could help in this case.

Re: Not Getting Fixed Value

I agree with tresesco‌. I don't think putting the field name twice in the set analysis would or should make any difference. I would love to see an example where this isn't the case. Would you be able to provide one mhmmd_srf‌?

vinieme12
Esteemed Contributor II

Re: Not Getting Fixed Value

Yep I know, but it seems there is something wrong with his data model

vinieme12
Esteemed Contributor II

Re: Not Getting Fixed Value

Just a thought, would a  keyfield cause such problem?  I haven't come across a situation like this before