Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need a automated script for reload in Qlikview.
i have a Menu table :
Here i have to check the presence of a brand LEVIS
LEVISCheck:
select distinct Brand_Name from MenuTable
where Brand_Name='LEVIS';
Now If the Brand name exsist then i have to load the LEVIS Dictionary table.
------------------------CHECK SCRIPT------------
Let RowCount=NoOfRows('LEVISCheck');
If '$(RowCount)'<>'0' THEN
------------------------------------------------------
LevisDetails:
select ID,ProductNo,order ,Stock,Price
from LEVIS_Data;
end if;
Now in case there is no LEVIS Brand then the error comes that Table Not found .
How to avoid this error.
Jagan ,
I do not want to use this function in .
Well I am now going for macro.
thank You guys for your valuable reply
Can you try using Peek function and storing the value from LEVISCheck table to a variable. And then try condiitional IF based on this newly created variable?
Does this meet your expectations?
Hi,
dont put 0 in the single quotes.
If '$(RowCount)'<>'0' THEN
this should be like below.
If '$(RowCount)'<> 0 THEN
Try and let us know.
-Nilesh
Can you try below:
If RowCount <>'0' THEN or
If RowCount <>0 THEN
Thanks,
Angad
Ok
Hi,
You can also set the ErrorMode= 0 : you will have an error, but that will not interrupt your process.
You may use also:
Tables:
SQLTables
In order to see the tables that have been read. But in your case, not sure, you will not have also an error.
Fabrice
Simplest method: use Lookup() function. Returns NULL if nothing found and doesn't require you to create a new table that may or may not exist.
For example:
:
LET vLevisExists = Lookup('Brand_Name', 'Brand_Name', 'LEVIS', 'MenuTable');
IF len(trim('$(vLevisExists)')) > 0 THEN
// Load Levis details table
END IF
:
or something like this. Note that this works even if MenuTable doesn't exist...
Peter
i can not set error mode to 0 because it will hide other valid reasons too .
Guys,
do we have any function to find the reloaded tables in Qlikview .
Hi Sujeet,
You can try using TableName() and TableNumber() functions for this. Please find below example. Table Number starts from 0.
Month:
LOAD * INLINE [
Month
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
];
LET vTableNumber = TableNumber('Month');
LET vTableName = TableName(TableNumber('Month'));
So, now vTableNumber = 0 and vTableName = Month after reloading.
Regards,
Jagan.