Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

nishanthi_8
Contributor

Dynamic Field value in the where condition

I have two table where month and year is used. I have attached the sample coding of that below :


Map_load:
Mapping load
"ID" ,
'Assigned' as PrjAssignment
Resident Assign
where Month_Year='Jun-2016';

//Assignment_Status:
join (Employees)
Load
"ID",
ApplyMap('Map_load',"ID",'Not Assigned') as Status

Resident Employees
where Month_Year='Jun-2016';

        Here the month and year should be dynamic for example if I have march,april,may it should take it dynamically without specifying in where clause like how it is done above. Any possible solutions for this ?

5 Replies
Not applicable

Re: Dynamic Field value in the where condition

where Month_year=date(today(),'MMM-YYYY')

nishanthi_8
Contributor

Re: Dynamic Field value in the where condition

TODAY will consider only today's month year for examply only july.But i have march and april also in the data how to fetch that

Not applicable

Re: Dynamic Field value in the where condition

where Month_Year >= date(addmonths(today(),-4),'MMM-YYYY')

sasiparupudi1
Honored Contributor III

Re: Dynamic Field value in the where condition

Use as follows

Map_load:

Mapping load

Month_Year&'|'&ID ,

'Assigned' as PrjAssignment

Resident Assign;

//Assignment_Status:

join (Employees)

Load

ID,

ApplyMap('Map_load',Month_Year&'|'&ID,'Not Assigned') as Status

Resident Employees;

nishanthi_8
Contributor

Re: Dynamic Field value in the where condition

Can you pls explain the logic for this ?