Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I am a beginner in qlikview platform and i am facing a problem in a text box
I am using the below equation in script window its working fine when i select female in list box but its showing the male count when i choose male in the list box
=num(sum({<[sex] = {'female'}>}POPULATION),'###,###,###')
and the following total population is changing along with the selection , for that i used the below queries
=NUM(SUM(POPULATION),'###,###,###')
i need this total value should be constant with respect to selected year and need not be change with by selecting the sex in list box.
Thanks in advance
Hi,
I guess the issue is that you are using SEX/sex with different cases.
Field names are case sensitiv in QlikView, so solutions for your expressions (total and female only, disregarding SEX selections) could be:
CrossTable([AGE RANGE], POPULATION, 5)
LOAD [Year of Estimate] AS YEAR,
[State Name]AS STATE,
[Race/Sex Indicator],
SubField([Race/Sex Indicator],' ',1) AS RACE,
SubField([Race/Sex Indicator],' ',-1) AS SEX,
[Under 5 years],
[5 to 9 years],
[10 to 14 years],
[15 to 19 years],
[20 to 24 years],
[25 to 29 years],
[30 to 34 years],
[35 to 39 years],
[40 to 44 years],
[45 to 49 years],
[50 to 54 years],
[55 to 59 years],
[60 to 64 years],
[65 to 69 years],
[70 to 74 years],
[75 to 79 years],
[80 to 84 years],
[85 years and over]
FROM [http://www.census.gov/popest/data/state/asrh/pre-1980/tables/PE-19.xls] (biff, embedded labels, header is 4 lines, table is [PE-19$]);
Using a personal edition you might not be able to open the attached qvw, while I could open yours using a licensed version.
(I'm convinced you'll purchase a license too, once you discoverd what QlikView can do for you )
hope this helps
regards
Marco
try this
=num(sum({1<[sex] = {'female'}>}POPULATION),'###,###,###')
so that it will show female count alone even if the selection differs.
your next ques about "=NUM(SUM(POPULATION),'###,###,###')" is not so clear
if you need to show count for a particular year, then use proper calendar in script.
and then do set analysis expression for that year
try total, then selection is ignored,
=NUM(SUM(total POPULATION),'###,###,###')
total can also be used with a dimension
or use 1 to select all data
=NUM(SUM{1} POPULATION),'###,###,###')
Greetings,
If you intend to ignore only the gender dimension when counting the total population, but include other dimensions such as year in the count, the expression should be as follows:
=NUM(SUM( {<sex= >} POPULATION),'###,###,###')
This way only selections made in "sex" list box will be ignored, all other selections will be considered.
Hi,
your original expression should work:
Can you post a sample app where it's not working to test with?
regards
Marco
Also verify if you have duplicate gender related fields in the table causing confusion, please share sample data for better understanding of the problem.
Hi Marco wedel
below is the link from where i get this data
http://www.census.gov/popest/data/state/asrh/pre-1980/tables/PE-19.xls
and clean the data by below approches
Directory;
CrossTable([AGE RANGE], POPULATION, 5)
LOAD [Year of Estimate] AS YEAR,
[State Name]AS STATE,
[Race/Sex Indicator],
SubField([Race/Sex Indicator],' ',1) AS RACE,
SubField([Race/Sex Indicator],' ',-1) AS SEX,
[Under 5 years],
[5 to 9 years],
[10 to 14 years],
[15 to 19 years],
[20 to 24 years],
[25 to 29 years],
[30 to 34 years],
[35 to 39 years],
[40 to 44 years],
[45 to 49 years],
[50 to 54 years],
[55 to 59 years],
[60 to 64 years],
[65 to 69 years],
[70 to 74 years],
[75 to 79 years],
[80 to 84 years],
[85 years and over]
FROM
[PE-19.xls]
(biff, embedded labels, header is 4 lines, table is [PE-19$]);
I try many approches but evry appraoch giving me a wrong answer,
i an using the free version so my app will not run in your system.
thanks in advance
regards
saugandh
Hi,
I guess the issue is that you are using SEX/sex with different cases.
Field names are case sensitiv in QlikView, so solutions for your expressions (total and female only, disregarding SEX selections) could be:
CrossTable([AGE RANGE], POPULATION, 5)
LOAD [Year of Estimate] AS YEAR,
[State Name]AS STATE,
[Race/Sex Indicator],
SubField([Race/Sex Indicator],' ',1) AS RACE,
SubField([Race/Sex Indicator],' ',-1) AS SEX,
[Under 5 years],
[5 to 9 years],
[10 to 14 years],
[15 to 19 years],
[20 to 24 years],
[25 to 29 years],
[30 to 34 years],
[35 to 39 years],
[40 to 44 years],
[45 to 49 years],
[50 to 54 years],
[55 to 59 years],
[60 to 64 years],
[65 to 69 years],
[70 to 74 years],
[75 to 79 years],
[80 to 84 years],
[85 years and over]
FROM [http://www.census.gov/popest/data/state/asrh/pre-1980/tables/PE-19.xls] (biff, embedded labels, header is 4 lines, table is [PE-19$]);
Using a personal edition you might not be able to open the attached qvw, while I could open yours using a licensed version.
(I'm convinced you'll purchase a license too, once you discoverd what QlikView can do for you )
hope this helps
regards
Marco