Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Is there a way I can create a virtual field within a table in Qliksense loadscript?
I have an 'ActiveDate' field, but would like to have an 'ExpiryDate' field added (which is ActiveDate+1095 days).
Or if there is another way you can think of doing this all suggestions will be welcomed. I want an actual field rather than just a measure of 'ActiveDate+1095 days' - if possible.
Thanks
You've been a community member since early 2021, you can't be that new... 🙂
LOAD StockpileId,
InternalReference,
FarmId AS [StockpileFarmId],
FieldId,
Tonnage,
CreationDate,
GridReference AS [StockpileGridReference],
CentroidGeom27700 AS [StockpileCentroidGeom27700],
S3ExemptionReference,
S3ExemptionActiveDate,
date(S3ExemptionActiveDate+1095) as ExpiryDate,
StockpileChecklistId,
IsEstimated,
StockpileTypeId,
RolloverTonnage,
BoundaryGeom27700 as [StockpileBoundaryGeom27700] ;
There's absolutely no problem doing that.
Load ActiveDate, Date(ActiveDate+1095) as ExpiryDate
From YourTable;
Amazing, thank you. Will try now
It didn't like it but there's a 100% chance I haven't done it correctly. This is the portion of my load script that loads the Stockpile table (the table in question)
LOAD StockpileId,
InternalReference,
FarmId AS [StockpileFarmId],
FieldId,
Tonnage,
CreationDate,
GridReference AS [StockpileGridReference],
CentroidGeom27700 AS [StockpileCentroidGeom27700],
S3ExemptionReference,
S3ExemptionActiveDate (This is the field I was referring to as ActiveDate),
StockpileChecklistId,
IsEstimated,
StockpileTypeId,
RolloverTonnage,
BoundaryGeom27700 as [StockpileBoundaryGeom27700] ;
SQL SELECT StockpileId,
InternalReference,
FarmId,
FieldId,
Tonnage,
CreationDate,
GridReference,
CentroidGeom27700,
S3ExemptionReference,
S3ExemptionActiveDate,
StockpileChecklistId,
IsEstimated,
StockpileTypeId,
RolloverTonnage,
BoundaryGeom27700
FROM COMPANYNAME.dbo.Stockpile;
Where should I be putting in that command you provided? Sorry, very new to this world.
You've been a community member since early 2021, you can't be that new... 🙂
LOAD StockpileId,
InternalReference,
FarmId AS [StockpileFarmId],
FieldId,
Tonnage,
CreationDate,
GridReference AS [StockpileGridReference],
CentroidGeom27700 AS [StockpileCentroidGeom27700],
S3ExemptionReference,
S3ExemptionActiveDate,
date(S3ExemptionActiveDate+1095) as ExpiryDate,
StockpileChecklistId,
IsEstimated,
StockpileTypeId,
RolloverTonnage,
BoundaryGeom27700 as [StockpileBoundaryGeom27700] ;
That worked perfectly, thanks.
I meant new to the load script world!
Cheers