on 01-29-2015 10:29 PM
Hi Guys,
In the Universe I have a table with the following dimensions UserID, Device Type, Time (see the sample data below). A user could have worked with a multiple devices over the period but can have only one at a time.
I need to create a report to find out whether the each user(user_id) had used a certain device type or not. If yes display the device type otherwise blank. The problem here is I have to display them in separate columns based on the device type. So basically in this case I need to display a column for each device type based for each user ID (something like this).
Not sure how this can be achieved. Any help would be appreciated.
Thanks
Dilip
Hi Dilip,
Pranay's first answer should have worked. He has suggested to create report level variables and not where clauses in the query panel.
Kind Regards
Mohan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can create two different variables in report for the above requirement. For example:
PC_Device =[Device Name] Where[Device Name]='PC_Device'
Mac_Device=[Device Name] Where[Device Name]='Mac_Device'
And pull both variables in a report. Please check and let me know how it goes.
Regards,
Pranay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your response Pranay. Sorry, I forgot to mention it in my original post that I have already tried the above scenario you mentioned. There was no data coming through when I pulled the UserID, PC_Device and Mac_Device columns in to the query. I checked the generated SQL and realized that it was generating an 'AND' in the where clause (see the below sql) so I changed the SQL(to use custom query) to 'OR' instead of 'AND" in the where clause, it was returning the data but its repeating the records twice (see the below table) which is not what I wanted . My requirement is to get single row for each user_id with PC_device column displaying 'PC' and Mac_Device column displaying 'Mac'.
SELECT
Table__2."user_id",
Table__2."device_type",
Table__2."device_type"
FROM
Table__2
WHERE
( Table__2."device_type"='PC' )
AND ( Table__2."device_type"='Mac')
So far I'm trying this in IDT 4.1sp3, not sure if there is a way we can create some variables and solve this issue in the Webi.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.