Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi below is my data.
Gender students | Present students | Absent students |
Male | 9 | 0 |
Female | 0 | 10 |
Now i want my table one more field as total students count so i want the total present and absent put in one field as Total students. kindly help me on the coding.please
Gender | Present | Absent | Total students |
Male | 9 | 0 | 9 |
Female | 0 | 10 | 10 |
Does this point you in the right direction ?
load
[Present students] + [Absent students] as [Total students],
*
;
LOAD [Gender students],
[Present students],
[Absent students]
FROM
[https://community.qlik.com/thread/158606]
(html, codepage is 1252, embedded labels, table is @1);
Try this:
Table:
LOAD Gender students,
Present students as Present,
Absent students as Absent,
(Present students + Absent students) as Total students
FROM xyz;
HTH
Best,
Sunny
if i try this i will get output as
Total students
19.
so the above output will be mixed of both male and female.
i need separate data for both male and femal
Total students
9
10
if i try this i will get output as
Total students
19.
so the above output will be mixed of both male and female.
i need separate data for both male and femal
Total students
9
10
Look at attached qvw, Male & Female are seperate :
That is not true. In the front end, if you create a chart with Gender students as your dimension and Sum(Total students) as your expression you will see this:
Gender students Total Students
Male 9
Female 10
Best,
Sunny
Tbl:
LOAD * Inline [
Gender students,Present students,Absent students
Male,9,0
Female,0,10 ];
Join(Tbl)
Load Sum([Present students]) As Prsnt, Sum([Absent students]) As Absnt Resident Tbl;
Final:
Load *,If(Gender='Male',Prsnt,Absnt) As Total Resident Tbl;
Drop Table Tbl;
1. u can simply load ur data through script
2. in straight/pivot table u can create one expression as sum(Present students)+sum(Absent students) and lable as Total
Hi,
You can see attached qvd.