Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi friends,
I have a student.qvd file. I have to display 2 reports. They are:
1) Student with id>150
2) Students whose address is not equal to India
I have written the following code:
report1:
load student.name,
student.address,
student.id
FROM
(qvd) where student.id>150;
report2:
load student.name,
student.address,
student.id
FROM
(qvd) where student.address<>'India';
Now, how i have to differentiate between student names between 2 reports?
Any help is greatly appreciated?
Hi,
You could give the first query as
load student.name as Student1,
student.address,
student.id
FROM
(qvd) where student.id>150;
and second as
load student.name as Student2
student.address,
student.id
FROM
(qvd) where student.address<>'India';
Then, in one chart, populate Student1 and Student2 in the other.
Regards,
Anju
HI,
Try this Code.
report1:
load student.name,
student.address,
student.id,
'Top150' as Source
FROM
(qvd) where student.id>150;
report2:
load student.name,
student.address,
student.id,
'Address' as Source
FROM
(qvd) where student.address<>'India';
On the basis of Source you can differentiate.
Regards,
Nirav Bhimani
Load all the data into one table and do the filtering in the reports. If you have QV11 this is very easy by defining Alternate States for the different charts.
Thanks Nirav for your reply,
But i don't want to display 'Source' in the report. Moreover, i want to display 2 different reports
Hi Gysbert, i am very new to QV and yes, my version is QV11.
Can you please elaborate your answer?
Hi,
You could give the first query as
load student.name as Student1,
student.address,
student.id
FROM
(qvd) where student.id>150;
and second as
load student.name as Student2
student.address,
student.id
FROM
(qvd) where student.address<>'India';
Then, in one chart, populate Student1 and Student2 in the other.
Regards,
Anju
You can Write Set Expression as,
Count ( {<Source= {'Top150'} >} name ) // For Report1
Count ( {<Source= {'Address'} >} name ) // For Report2
No need to display in front end.
Regards,
Nirav Bhimani
Thanks Anju. It worked well.
Similarly do i have to do for address and id?
Can't i define the entire "load block" with any variable?
No, you don't have to do it for address and id .....it will automatically populate the correct address and id.
We can't define an entire block with a Load variable. But, I guess qlikview somehow 'remembers' which query is responsible for a variable
Regards,
Anju