Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm new to both these boards and QlikView programming, so forgive me if this is very simple...
I have a list box which get's it's values from a filed which is just True or False... 0 or 1.
Currenly, the list displays 0 and 1 as the selections. I would rather it dispay "Active" for 0 and "Inactive" for 1.
I haven't figured out how to do that. Any help would be appreciated.
Thanks,
Jack
Hello,
the logic is slightly different:
ODBC Connect ..... ;
Placements_IN:
SQL SELECT .... FROM .... WHERE ..... ;
// now you have a table Placements which holds all the data from the Select
// the next step is to reload the data to do some manipulations.
// For simplicity, let's say you loaded fields A,B and C
Placements:
noconcatenate LOAD
*, //this loads A,B,C
if(A=0,'F','T') as D
resident Placements_IN;
drop table Placements_IN;
//done!
Just to confuse you 😉 ... this can be done in 1 step:
Placements:
LOAD
*,
if(A=0,'F','T') as D
;
SQL SELECT .... FROM ... WHERE ....
This loads the data from SQL and used that as input for the above(!) defined LOAD.
This syntax creates just the one table you need, so no drop table is required.
hth,
Thilo
Hello,
I would do that translation on load time:
LOAD
...
field as MyBoolean, // 0 or 1
if(field = 0,'Inactive','Active') as MyBooleanLong
...
FROM ...
In the report you show MyBooleanLong rather than MyBoolean.
hth,
Thilo
Thanks for the quick reply. I'm having issues with the Load statement (again, I'm new).
Here's what I have:
Placements:
ODBC
CONNECT TO[MS Access Database;DBQ=J:\Database\AgencyDatabase_be.accdb];
SQL
SELECTAcknowAttachment,
AcknowReceived,
AgencyID,
Clients,
ContingencyRate,
`Count`,
InputDate,
NoOfPriorPlacements,
Notes,
Owner,
PlacedAmount,
PlacementDate,
PlacementID,
RecallCount,
RecallDate,
RecallFileReceived,
UserID
FROM
Placement;
Load
RecallFileReceived
as PlcmntStsDisplay,// 0 or 1
if
(RecallFileReceived = 0,'Inactive','Active') asPlcmntStsDisplayLong
From
Placements;
I get this error:
Cannot open file 'C:\Documents and Settings\jmahoney\My Documents\NCA\Reports\Database\QlikView\Placements'
Load
RecallFileReceived as PlcmntStsDisplay,
if(RecallFileReceived = 0,'Inactive','Active') as PlcmntStsDisplayLong
From Placements
Hello,
the logic is slightly different:
ODBC Connect ..... ;
Placements_IN:
SQL SELECT .... FROM .... WHERE ..... ;
// now you have a table Placements which holds all the data from the Select
// the next step is to reload the data to do some manipulations.
// For simplicity, let's say you loaded fields A,B and C
Placements:
noconcatenate LOAD
*, //this loads A,B,C
if(A=0,'F','T') as D
resident Placements_IN;
drop table Placements_IN;
//done!
Just to confuse you 😉 ... this can be done in 1 step:
Placements:
LOAD
*,
if(A=0,'F','T') as D
;
SQL SELECT .... FROM ... WHERE ....
This loads the data from SQL and used that as input for the above(!) defined LOAD.
This syntax creates just the one table you need, so no drop table is required.
hth,
Thilo
Got it, thanks!
Placements:
Load *,
If (RecallFileReceived = 1,'Inactive','Active') as PlcmtStatusDisplayLong;
ODBC CONNECT TO [MS Access Database;DBQ=J:\DATABASE\AgencyDatabase_be.accdb];
SQL SELECT *
FROM Placement;