Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 2 date fields which I need to compare:
I want to compare SNOWKEY_LENEL vs SNOWKEY_SNOW;
I only want to see the those which do not correspond but "Day_of_Visit" may not be older then the "Badged-date".
The field SNOWKEY_LENEL is a concatination of the numeric datefield "Badged_date" and a non unique number so this concatination makes it a unique field
The field SNOWKEY_NOW is a concatination of the numeric datefield "Day_of_Visit" and a non unique number so this concatination makes it a unique field
In my script I already had to make some format change on the "Day_of_Visit"
Date(Date#([Day of Visit],'mm-dd-yyyy'),'DD/MM/YYYY') as Day_of_Visit,
Do not correspond to what ?
As far as I can understand you can do this in script
where Day_of_Visit < Badged_Date
or you can create this flag, if(Day_of_Visit < Badged_Date,1,0) as Flag and use this flag in your expression in UI
This will give you all the records where Day_of_Visit is not more than Badged_Date.
Your question seems incomplete...What are you looking to compare? the number of days between the 2 dates? i.e. "Badged_date"-"Day_of_Visit" as Num_Of_Days
Indeed my question was confusing and incomplete. I tried to be more clear now.
Do not correspond to what ?
As far as I can understand you can do this in script
where Day_of_Visit < Badged_Date
or you can create this flag, if(Day_of_Visit < Badged_Date,1,0) as Flag and use this flag in your expression in UI
This will give you all the records where Day_of_Visit is not more than Badged_Date.
My field Badged_date and SNOWKEY_LENEL come from 1 data connection qvd
My field Day_of_Visit and SNOWKEY_SNOW come from anoter data connection (excel)
In which load script do I put this Where or If clause?
Hi @Sugy ,
In order to compare two date fields, you need to join the tables or concatenate the two tables based on your requirement. Once, the date fields come under the same table, you'll be able to compare them.
Also, make sure that both the date fields are in the same format
You will need to join both these table on common key/ primary key and then make another table and load joined data as resident load there apply this logic.
Example:
NoConcatenate
Temp_Table:
Load ID,Day_of_Visit from Table1;
Left Join(Temp_Table)
Load ID,Badged_Date from Table2;
NoConcatenate
Final_Table:
Load *,
if(Day_of_Visit < Badged_Date,1,0) as Flag
Resident Temp_Table where Day_of_Visit < Badged_Date ;
Drop Table Temp_Table;