Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys, stalwar1
Suppose I have a table containg a field Alert:
load Alert inline [
Alert
alert1
alert2
alert3
];
How to do to store all of the alerts (alert1, alert2 and alert3) into a variable?
the goal is to store all this values ito a database as a final objectif; for this, I want to be able to loop all the alerts one by one, and everytime store one value into the destination column, till all the values are stored.
Hope my question is clear enough?
Try it like this Sunny ! It works !
alerts:
load Alert inline [
Alert
alert1
alert2
alert3
];
FOR Each a in FieldValueList('Alert')
dim:
let vAlert = a;
LOAD '$(vAlert)' as Alerts AutoGenerate 1;
Store dim into [lib://OBS/class.txt] (txt);
NEXT a
May be like this
load Alert inline [
Alert
alert1
alert2
alert3
];
For i = 1 to FieldValueCount('Alert')
LET vAlert$(i) = FieldValue('Alert', $(i));
NEXT i;
what to do to store it in a txt file for example?
when I exactly copy your script and then do as follow, I have this answer
Table:
LOAD $(vAlert$(i)) as [Variable Value]
AutoGenerate 1;
STORE [Variable Value] FROM Table INTO [lib://OBS/class.txt]
(txt);
You can store a table, not a variable value... what exactly are you trying to do?
I want to be able to store alerts from qlik sense into a database table ; I'm inspired by this:
so what I'm trying to do, is to store all the values (all the alerts) into the variable, and then call the procedure to each time store an alert.
I see that he's using a variable vCompany, that's why I thought about using variables.
Hope this was clear..
And ps:
I see here that It's possible to store a variable into a table:
This is out of my league Omar... I won't be able to help you with this brother
when I tried this:
alerts:
load Alert inline [
Alert
alert1
alert2
alert3
];
For i = 1 to FieldValueCount('Alert')
LET vAlert = FieldValue('Alert', $(i));
Table:
//LOAD $(vAlert) as [Variable Value] AutoGenerate 1 ;
load FieldValue('Alert', $(i)) as alert resident alerts;
STORE alert FROM Table INTO [lib://OBS/class.txt]
(txt);
NEXT i;
each alert is stored 3 times; (problem with the loop logic)
but when I try it with variable instead; I have this:
Try -> Concat(FieldName, ',') as FieldNameList
You can store a variable into a table, but you can store a table into a txt file like this
Table:
LOAD $(vAlert$(i)) as [Variable Value]
AutoGenerate 1;
STORE Table FROM Table INTO [lib://OBS/class.txt]
(txt);
But this is not possible
Table:
LOAD $(vAlert$(i)) as [Variable Value]
AutoGenerate 1;
STORE [Variable Value] FROM Table INTO [lib://OBS/class.txt]
(txt);