Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
sindhu_ibizcs
Partner
Partner

Get selected count

Hai,

sum(if(getselectedcount(month)=0 or getselectedcount(day)=0 or getselectedcount(year)=0,qty,mnth_qty)

can anyone explain how does it works..what is the result of this.

Thanks in advance

1 Solution

Accepted Solutions
omkarvamsi
Creator
Creator

Hi,


sum(if(getselectedcount(month)=0 or getselectedcount(day)=0 or getselectedcount(year)=0,qty,mnth_qty)


getselectedcount(field) :Gets the output of number of values which we selected from field.

if you select jan,feb from month field,the output will  be 2.

so when ever you didn't make any selections on any one of month,day,year.

the output will be =0,

The condition becomes true because the selection count of the field =0.So the the "Qty" will be the result.

else "mnth_qty"


Hope i make it clear for you


View solution in original post

10 Replies
kaushiknsolanki

HI,

The flow of expression is this way.

If the Value is not selected in Filters like Month, Day and Year then sum the qty of any value is selected from any of this 3 filters then sum the Month Qty.

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
surendraj
Specialist
Specialist

Suppose you have..fields month,day,year

if you select any one/two of above three fields TRUE statement will be exicuted.(qty)

if you select three of above fields FALSE  statement will be exicuted.(mnth_Qty)

Anil_Babu_Samineni

This will working as like below

If no selections Sum(qty) else Sum(mnth_qty)



Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
sindhu_ibizcs
Partner
Partner
Author

getselected count function is count the value ,right.and then it'll check condition.am i right.is there any option instead of this function

surendraj
Specialist
Specialist

Hi Anil,

Here or is included in between the conditions.so if he may select any one of the field that will be true.

In above if one condition is true then true is executed.

Am  i correct?

omkarvamsi
Creator
Creator

Hi,


sum(if(getselectedcount(month)=0 or getselectedcount(day)=0 or getselectedcount(year)=0,qty,mnth_qty)


getselectedcount(field) :Gets the output of number of values which we selected from field.

if you select jan,feb from month field,the output will  be 2.

so when ever you didn't make any selections on any one of month,day,year.

the output will be =0,

The condition becomes true because the selection count of the field =0.So the the "Qty" will be the result.

else "mnth_qty"


Hope i make it clear for you


View solution in original post

surendraj
Specialist
Specialist

yes..suppose if u select 2 fields from month field.then getselectedcount(month)=2..

Anil_Babu_Samineni

Assumption is correct

If you select anything from those three statements it will give True condition or else false condition

Reply for Last response, yes you are right. There is no other option. Only we have GetSelectedCount() it will get the count of dimension where out static value gives.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
sindhu_ibizcs
Partner
Partner
Author

Thanks to all.