Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
karthikeyan1504
Creator III
Creator III

Input box issue

Hi All,

jagan‌, tresesco‌, hic‌, swuehl‌, gwassenaar‌, maxgro

I have the details of year, no of students, students responded to the survey and their ratings in students table.

The requirement to have 4 input box filter to select minimum and maximum of no of students and the no of respondents to choose.

Please refer the below screenshot,

Capture.PNG

Based on the input box filters of minimum and maximum no of students and the no of respondents the expression should change in 'Test' table. Here my challenging is to handle the expressions when the value is not entered in any input box filter or entered in any of one or two or three. I have tried conditional view of expression based on the filter values, but as we have four filters the combination is 16 for each expressions.

It looks bit tedious. Could anyone please help me on this?

Please find the attached qvw and data...

Thanks & Regards,

Karthikeyan.

19 Replies
karthikeyan1504
Creator III
Creator III
Author

Yes.

Say if the user doesn't enter value in all the input box and enters in one or two or three... the expression will not work.

That is the challenge I face here.

tamilarasu
Champion
Champion

Try below,


= if($(vMinClass)=0 and $(vMaxClass)=0,sum([No of Students]),

        sum({<Term={"=aggr(sum([No of Students]),Term)>$(vMinClass) and

                aggr(sum([No of Students]),Term)<$(vMaxClass)"}>}[No of Students]))

Modify the responded and rating column accordingly.

karthikeyan1504
Creator III
Creator III
Author

Hi Tamil,

This would work for scenarios where the user enters the value in all filters or doesn't.

This expression will still fail if the user only enters the minimum value alone in both the filter.

tresesco
MVP
MVP

With integer constraints enabled, they would be treated as 0 (zero). Or, how do you want them to behave like?

karthikeyan1504
Creator III
Creator III
Author

Hi tresesco

I got your point.It worked

But ended up with the huge expression,

if(vMaxClass<>0 and vMaxResp<>0

,avg({<Term={"=Sum([No of Students])>=$(vMinClass) and Sum([No of Students])<=$(vMaxClass)

and Sum([No of Students responded])>=$(vMinResp) and Sum([No of Students responded])<=$(vMaxResp)"}>} Rating)

,if(vMaxClass<>0 and vMaxResp=0

,avg({<Term={"=Sum([No of Students])>=$(vMinClass) and Sum([No of Students])<=$(vMaxClass)

and Sum([No of Students responded])>=$(vMinResp)"}>} Rating)

,if(vMaxClass=0 and vMaxResp<>0

,avg({<Term={"=Sum([No of Students])>=$(vMinClass) and Sum([No of Students responded])<=$(vMaxResp)

and Sum([No of Students responded])>=$(vMinResp)"}>} Rating)

              

,avg({<Term={"=Sum([No of Students])>=$(vMinClass)

and Sum([No of Students responded])>=$(vMinResp) "}>} Rating))))

I can manage with this. Still if there any efficient way please let me know.. because I need to have 5 expression in the same chart few more calculation.

Thanks & Regards,

Karthikeyan.

karthikeyan1504
Creator III
Creator III
Author

Hi tresesco

I am bit confused with the set analysis...

Since we have only one dimension we have given as


Term={"=Sum([No of Students])>=$(vMinClass).


If we have more than one dimension, how can we handle the same?


Thanks & Regards,

Karthikeyan.

tresesco
MVP
MVP

For multiple dimensions, the dimension with more granularity should be considered in the set expression.

karthikeyan1504
Creator III
Creator III
Author

Sorry I am bit lost here.

How to amend the expression, if we have a dimensions as Term & Module..

Should it be as Module={"=Sum([No of Students])>=$(vMinClass)} ?

Thanks

tresesco
MVP
MVP

Set analysis doesn't work row-wise. However, you can restrict the rows from the chart at one go - and there dimensions wouldn't matter. Try with the same expression (with 'Term').

karthikeyan1504
Creator III
Creator III
Author

Thank you so much...

Learnt bit more on set analysis.

Job done!!!