Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I am trying to run a query,but I am not getting the desired output.
LOAD
COMPONENT_NAME,
RESULT_VALUE,
TEST_ID,
if(upper(COMPONENT_NAME)='IRON AS FE',Count(if(RESULT_VALUE >=15,'5'))) as Ind
from result.qvd
Group by
COMPONENT_NAME,RESULT_VALUE,TEST_ID;
But everytime it get 0,1 as Ind
Is there any pblm ion my script???
I tried the above mentioned query but count returns only 0 and 1,nothing else.
Hi Neha,
I think it is not possible to calculate in backend, try like this
Load all the data and then use this Set Analysis expression
=Count({<COMPONENT_NAME={'IRON AS FE'}, RESULT_VALUE={'>15'}>} TEST_ID)
Regards,
jagan.
Hi All,
I found the solution for this.
Final:
LOAD TEST_ID,
COMPONENT_NAME,
RESULT_VALUE,
if(upper(COMPONENT_NAME)='IRON AS FE' and RESULT_VALUE >=15,RESULT_VALUE) as Ind
FROM
[RESULT.qvd]
(qvd);
temp:
load distinct Ind as IND1
Resident Final Where Exists (Ind);
let v_var=NoOfRows('temp');
load distinct *,'$(v_var)' as Count resident Final;
Here we can get the count at backend only.
Hi Neha,
Try this simple script
Source:
LOAD * INLINE [
COMPONENT_NAME, RESULT_VALUE, TEST_ID
IRON AS FE, 18, 299
MN, 20, 768
AG, 21, 578
IRON AS FE, 24, 765
IRON AS FE, 4, 676
];
Data:
LOAD
COMPONENT_NAME,
Count(TEST_ID) AS Result_GR_15
RESIDENT Source
WHERE COMPONENT_NAME = 'IRON AS FE' AND RESULT_VALUE > 15
GROUP BY COMPONENT_NAME;
Regards,
jagan.