Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone !
I have a task where I need to create a sample table which as 40 random rows in it from an existing tab and I have already this script using Sample() but sample doesn't return a fix value and I would like to know if it is possible to have it return only 40 values (for now it returns between 30 and 60 rows).
[App_Name]:
DT_MAJ,
ID_APL as ID,
LB_APL as Name,
MC_MAJ;
SQL SELECT *
FROM "LUAU_UCR".dbo."TB_Application";
LET vTotalRows = NoOfRows('App_Name');
LET vPercent = (100 * 40 / $(vTotalRows)) / 100 ;
[Sample_Table]:
QUALIFY *;
Sample $(vPercent) LOAD * Resident App_Name;
You could either generate this sample in SQL itself or use the QlikView prefix First rather than Sample, maybe sorting by a random value you generate in your initial load.
https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptP...
You could either generate this sample in SQL itself or use the QlikView prefix First rather than Sample, maybe sorting by a random value you generate in your initial load.
https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptP...