Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for
Search instead for
Did you mean:
Contributor

## Less than equal to Selected year and month

i need to show data until selected year and Month

have Joining date till the selected year moth need to know number of employees

tried build two variables

1.vYear ==passing selected year

2. vMonth =passing selected Month

3. concatenation both variables vyearmonth =vYear &vMonth

have column year(joinng date)&month(joining date)  created this column in database

201901

201902

201903

.

.

.

used below expression but not working

=Count(distinct{<yearmonth=  {"<=\$(vyearmonth )"}>} empno)

need urgent

it s beheaving strange

1 Solution

Accepted Solutions
Partner - Champion

I think you should use the below expression:

Count( {< year =, month =, yearmonth =  {"<=\$(=vYearMonth )"} >} distinct empno )

I hope it will fix your problem.

14 Replies
Partner - Master III

try \$(=

=Count(distinct{<yearmonth=  {"<=\$(=vyearmonth )"}>} empno)

Specialist

i did not get it well

you can try

=Count(distinct{<yearmonth=  {"<=vyearmonth "}>} empno)

Contributor
Author

hi  dilip thank you for help

i use ur expression it s giving data for selected year and month..i want to show data until selected year and month

Contributor
Author

hi jahanzeb,

my requirement is user select year and month ,i need to count number of employees until selected year and month

i created 3variable

vYear= selected year

vMonth= Selected Month

i concatenated two variables in to one variable

vYearMonth =vYear&vMonth

my expression below

Count(distinct{<yearmonth=  {"<=\$(=vYearMonth )"}>} empno)

my expression not giving data lessThan equal selected Year Month

it is giving data for selected month and year ...i need less than selected year month

have columns

Partner - Master III

Not sure I understand the problem. Do you mean if users select 201809 it should show 201808 and below?

If so just to change expression in < rather than <=

Count(distinct{<yearmonth=  {"<\$(=vyearmonth)"}>} empno)

Specialist

So may be

Count(distinct{<yearmonth=  {"<=max(yearmonth) >=\$(=vYearMonth )"}>} empno)

or change some thing that you can get today's yearmonth or may be max

regards

Partner - Champion

what's your current selection ?

also make sure 20188 should be 201808, 20181 -> 201801, etc... in your "yearmonth" field.

Contributor
Author

but use select 2019 as year and 09 month

need to selections

created two variables

vYear

VMonth

and concatenated

have DB column YearMonth

i use below expression it is showing only for selected year and month not showing all values

Contributor
Author

Than you Andrea

i change my data

i need expression my expression not giving <= values