Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
zied_ahmed1
Specialist
Specialist

convert sql transaction to script code qlik sense

Hello i need to calculate ratio between :

Number of cars in sql is :


SELECT * FROM table WHERE Type= 'car' and date='2017' (i need this in script as Number_cars)

Number actif cars in sql is :

SELECT DISTINCT (Machine) FROM table WHERE Type= 'car' and date='2017' ( I need this in script as Active_cars)

Thanks for help

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

ODBC CONNECT ....

or

OLEDB CONNECT ....


Number_cars:

SQL SELECT * FROM table WHERE Type= 'car' and date='2017';

Active_cars:

LOAD Machine as Active_cars;

SQL SELECT DISTINCT Machine FROM table WHERE Type= 'car' and date='2017';

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
zied_ahmed1
Specialist
Specialist
Author

Hello Jonathan,

I already loaded previously these fields  : Type and date and Machine to do some works,

no i need after that add script code like the two transactions

zied_ahmed1
Specialist
Specialist
Author

stalwar1‌ any suggestions please?