Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mofqlikproject
Contributor
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
agigliotti
Partner - Champion
Partner - Champion

I think you should use the below expression:

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


I hope it will fix your problem.

View solution in original post

14 Replies
dplr-rn
Partner - Master III
Partner - Master III

try $(=

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

zebhashmi
Specialist
Specialist

i did not get it well

you can try

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

mofqlikproject
Contributor
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

mofqlikproject
Contributor
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

emp.PNG

dplr-rn
Partner - Master III
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)

zebhashmi
Specialist
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


agigliotti
Partner - Champion
Partner - Champion

what's your current selection ?

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

mofqlikproject
Contributor
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

mofqlikproject
Contributor
Contributor
Author

Than you Andrea

i change my dataCapture.PNG

i need expression my expression not giving <= values