Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
josephinetedesc
Creator III
Creator III

set analysis question

Hi all this works

- as Classification = Clinical - will not change no matter what Classification is chosen by the user.

(Sum({$<Classification={'Clinical'}>}DurMins))/Sum({1}AvailMins)

This expression is better because if the week has 2 months - it will still calculate correctly.

if

(Classification = 'Clinical',((sum({$<WeekNum = p(WeekNum), Date_Fin_Month = >}DurMins))/(sum({$<WeekNum = p(WeekNum), Date_Fin_Month = >}AvailMins))))

 

However, a user needs to make a selection of Clinical.

I would like to make it that a User did not need to select Classification = Clinical but always stays as Clinical.

I have tried combining the two expresssions but it is hard and I end up with commas and brackets left over!

How could I modify the if statement???

Jo

6 Replies
tamilarasu
Champion
Champion

Hi Josephine,

Something like below,

If(Classification = 'Clinical' or Classification <> 'Clinical' ,

      Sum({$<WeekNum = p(WeekNum), Date_Fin_Month = >}DurMins) / Sum({$<WeekNum = p(WeekNum),

     Date_Fin_Month =>}AvailMins))

josephinetedesc
Creator III
Creator III
Author

Thanks Tamil.. still need to choose Clinical to be correct

karthikeyan1504
Creator III
Creator III

Hi Josephine,

have a variable like vClassification = if(getselectedcount(classification)=1 and getcurrentselections(classification)<>'Classification: Clinical', only(classification), 'Clinical')

and refer the variable in set analysis as below,

(Classification = {$(vClassification },((sum({$<WeekNum = p(WeekNum),Date_Fin_Month = >}DurMins))/(sum({$<WeekNum = p(WeekNum),Date_Fin_Month = >}AvailMins))))


Warm Regards,

Karthikeyan.

PrashantSangle

Hi,

try after including Classification='Clinical' in your set analysis.

You dont required if statement.

try like

((sum({$<WeekNum = p(WeekNum),Classification={'Clinical'}, Date_Fin_Month = >}DurMins))/(sum({$<WeekNum = p(WeekNum), Classification={'Clinical'},Date_Fin_Month = >}AvailMins)))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
josephinetedesc
Creator III
Creator III
Author

Thank you Max Dreamer - it worked.

so if I try and understand it ...

(

(sum({$<WeekNum),Classification={'Clinical'}, Month= >}DurMins))

/

(sum({$<WeekNum), Classification={'Clinical'},Month = >}AvailMins))

)

PrashantSangle

Welcome

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂