Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi i have a table and it contains a filed name country.Which contains country names .I want to find how many times specified country names are populated and percentage of the total count of the country name occurrence to the row count with in a specific date. I am using an expression
count({<country={'India',USA','UK','Singapore','Canada'}>}If(Date >= $(vStartDate) AND Date <= $(vEndDate),country)) to find the count.
and using
count({<country={'India',USA','UK','Singapore','Canada'}>}If(Date >= $(vStartDate) AND Date <= $(vEndDate),country)) /count(TOTAL(country))* 100 to find the avg.But i am not getting the correct result.
Couple things to try
1) you are missing a single quote before USA ..it says: ,USA'
count({<country={'India',USA','UK','Singapore','Canada'}>}If(Date >= $(vStartDate) AND Date <= $(vEndDate),country))
2) combine date search in set analysis modifier
count( {<country={'India','USA','UK','Singapore','Canada'}, Date={">=$(vStartDate)<=$(vEndDate)"}>} country)
... but i'd suggest copy/pasting the above in the label of the expression to ensure the date search mask is calculating right .
Hi Ryan,
you have a quote missing before USA, is that just a typo?
Ha previous reply arrived whilst writing - agree with the above, PS you don't need the * 100 if you format the output number as 'show in per cent (%)
Andy
quote missing is typo error
hi,sorry the solutions are not working for me..
@jonathan poole when i am using date expression like you mentioned all the values are showing 1
hi thank for the help,but when i am using date expression like you mentioned all the values are showing 1
If i were to guess its probably a date format issue with the Date, and making sure the date range for #2 matches your current Date format for the Date field . Please upload your QVW or a sample QVW .