Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

help on data

Hi below is my data.

   

Gender studentsPresent studentsAbsent students
Male90
Female010

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

    

GenderPresentAbsentTotal students
Male909
Female01010
11 Replies
Anonymous
Not applicable

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);

sunny_talwar

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

manoranjan_d
Specialist
Specialist
Author

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

manoranjan_d
Specialist
Specialist
Author

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

Anonymous
Not applicable

Look at attached qvw, Male & Female are seperate :

sunny_talwar

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

anbu1984
Master III
Master III

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;

buzzy996
Master II
Master II

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

Not applicable

Hi,

You can see attached qvd.