Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 10 expressions calculated from a single table and set to 10 variables. How can I create a QVD from these?
I tried ..
v1 = sum(if(status = 'A',field1));
v2 = sum(if(status = 'B',field2));
Store v1,v2,.... into x.qvd but it didn't work may be because of using aggregate functions in the expression applied on same table.
Any alternative will be appreciated.
Thank you!
regards,
Rishu
Hi,
Please check the attached sample may help you in storing the variable values into QVD and retrieving back the values from QVD and assign to the variables when you reload next time.
Cheers.
Hi Mayank,
You need to make resident table for that.
Anand
Hi,
I haven't test this, but you can try the following:
Table1:
load sum(if(status = 'A',field1)) as v1,
sum(if(status = 'B',field2)) as v2,
field3,
field4
from ....
group by field3, field4;
Table2:
load v1,
v2
resident Table1
store Table2 into Table2.qvd;
Hope this helps
Regards!
Hi
If you dont know how to right resident table please see for variables.
v1 = sum(if(status = 'A',field1));
v2 = sum(if(status = 'B',field2));
Tab1:
Col1,
Col2,
sum(if(status = 'A',field1)) as v1,
sum(if(status = 'B',field2)) as v2,
from Data;
Tab2:
load
col1,
col2,
V1,
V2
resident Tab1;
Regards,
Anand
Hi,
I did not checked the if formulas but focused on storing the variables.
Try this:
//---------------------------
[Temp]:
LOAD * INLINE [
F1
A
];
let v1 = 10;
let v2 = 20;
inner Join LOAD *,$(v1) as v1,$(v2) as v2 Resident [Temp];
drop Field F1;
//---------------------------
you will get a table called Temp containing 2 fields v1 & v2 with their values.
Hi Mayank,
Try this code
Table1:
LOAD Agent,
Sales,
Sum(if(Agent = 'A',Sales)) as v1,
Sum(if(Agent = 'B',Sales)) as v2
FROM
(ooxml, embedded labels, table is Sheet1)
group by Agent,
Calls,
Duration,
Sales;
Table2:
load
Agent,
Sales,
v1,
v2,
1 as junk
Resident Table1;
Store Table2 into Table2.qvd;
Drop table Table1;
Regards
Anand
Hi Mayank,
Use above code according to your requirements and fields.
Regards,
Anand
Hi,
Please check the attached sample may help you in storing the variable values into QVD and retrieving back the values from QVD and assign to the variables when you reload next time.
Cheers.
Thanks to all....I got it done!
regards,
Mayank
Is there any way to get back the calculated result from a variable and store it in a qvd??
for example lets say i have count(Volume) which calculates in 10 in the interface, is there any way to retrieve this number and store it on a qvd??