Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

compare if one variable is between two field objects

Hello! Thank you first for taking the time to read this, and hope that you will be able to help me!

I am creating a dashboard where I have a variable the variable for dates of purchase and delivery.  I separate the 365 days of the year into 52 week segments, and so I would like to see which week segement the date falls into.  If you have any ideas on how I can compare one variable to two fields, I would greatly appreciate it!

Thank you!

5 Replies
vinieme12
Champion III
Champion III

what do you want to achieve with this?

use the same logic you used to create the week numbers and compare with week numbers of those dates


Purchasedate = Week($(datevariable1))

Deliverydate = Week($(datevariable1))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Thank you Vineeth for your response!

Do you think that there is any way I could make this work using the trigger function?  I would like to be able to plug in into a input box, the week number (or a specific day of the month) and then it only shows me the furniture bought inbtw in that period.  The period will be dictated by pre-set definitions of what week is what period.

Thanks so much!

vinieme12
Champion III
Champion III

Can you provide sample app / data?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MarcoWedel

Hi,

one solution without the need for variables or triggers might be:

QlikCommunity_Thread_243392_Pic1.JPG

QlikCommunity_Thread_243392_Pic2.JPG

or

QlikCommunity_Thread_243392_Pic3.JPG

QlikCommunity_Thread_243392_Pic4.JPG

//creation of sample data

tabSales:

LOAD *,

    DayName(PurchaseDate+Pow(Rand(),3)*100) as DeliveryDate;

LOAD RecNo() as ID,

    DayName(YearStart(Today())+Rand()*265) as PurchaseDate

AutoGenerate 20;

tabCalendar:

LOAD *,

    Day(Date) as Day,

    WeekDay(Date) as WeekDay,

    Week(Date) as Week,

    WeekName(Date) as WeekName,

    Month(Date) as Month,

    MonthName(Date) as MonthName,

    Dual('Q'&Ceil(Month(Date)/3),Ceil(Month(Date)/3)) as Quarter,

    QuarterName(Date) as QuarterName,

    Year(Date) as Year,

    WeekYear(Date) as WeekYear;  

LOAD Date(MinDate+IterNo()-1) as Date

While MinDate+IterNo()-1 <= MaxDate;

LOAD Min(PurchaseDate) as MinDate,

    Max(DeliveryDate) as MaxDate

Resident tabSales;

tabLink:

IntervalMatch (Date)

LOAD Distinct

    PurchaseDate,

    DeliveryDate

Resident tabSales;

hope this helps

regards

Marco

Anonymous
Not applicable
Author

Hi ,

Can you share sample documents.