Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
josephinetedesc
Contributor 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

Tags (1)
6 Replies

Re: set analysis question

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
Contributor III

Re: set analysis question

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

karthikeyan1504
Contributor III

Re: set analysis question

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.

Re: set analysis question

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.
josephinetedesc
Contributor III

Re: set analysis question

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))

)

Re: set analysis question

Welcome

Great dreamer's dreams never fulfilled, they are always transcended.
Community Browser