Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to create a flag using an if statement but having a hard time getting my expression approved in Qlik.
Here is what I am trying to accomplish. If a SALE DATE falls under the last 7 days, flag it as 'Last Week', else flag it as 'NA'
if ( SALE_DATE = {">=$(=Date(Today()-7, 'MM/DD/YYYY')) <=$(=Date(today(), 'MM/DD/YYYY'))"}, 'Last Week', 'NA')
Thank you.
It looks like you're mixing up if() and set analysis. Assuming this is in script (which is where you'd typically want to create flags):
if(SALE_DATE >= Today()-7 AND SALE_DATE <= Today(),'Last Week','NA') as My_Flag
It looks like you're mixing up if() and set analysis. Assuming this is in script (which is where you'd typically want to create flags):
if(SALE_DATE >= Today()-7 AND SALE_DATE <= Today(),'Last Week','NA') as My_Flag
Thank you. This was for the script side and absolutely lost it for a second there.