Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

need to Condition verify

Hi Folks,

i am trying to display latest 12 weeks data in the below expr, can any one correct it.

If( GetSelectedCount(WeekFlag)=0 and GetSelectedCount(QuarterFlag)=0,

Count({$<WeekFlag={">=$(=(Max(WeekFlag))-84)}<$(=(Max(WeekFlag)))"}>}WeekFlag),

If(GetSelectedCount(QuarterFlag)>0,GetFieldSelections(QuarterFlag),GetFieldSelections(WeekFlag))

)

Now i go all the weeks data. i wat to show only last 12 weeks.

Regards,

Sub2u444.

6 Replies
sunny_talwar

How does the WeekFlag field look like? Is it a datefield or a flag created on datefield?

sunny_talwar

Try this:

If(GetSelectedCount(WeekFlag) = 0 and GetSelectedCount(QuarterFlag) = 0,

Count({$<WeekFlag={">=$(=Max(WeekFlag)-84))<$(=Max(WeekFlag))"}>}WeekFlag),

If(GetSelectedCount(QuarterFlag) > 0, GetFieldSelections(QuarterFlag), GetFieldSelections(WeekFlag)))


You mistakenly used a curly brackets in place of parenthesis

Not applicable
Author

Its Date Only.

sunny_talwar

If is it number formatted:

If(GetSelectedCount(WeekFlag) = 0 and GetSelectedCount(QuarterFlag) = 0,

Count({$<WeekFlag={">=$(=Max(WeekFlag)-84))<$(=Max(WeekFlag))"}>}WeekFlag),

If(GetSelectedCount(QuarterFlag) > 0, GetFieldSelections(QuarterFlag), GetFieldSelections(WeekFlag)))

If date formatted:

If(GetSelectedCount(WeekFlag) = 0 and GetSelectedCount(QuarterFlag) = 0,

Count({$<WeekFlag={">=$(=Date(Max(WeekFlag)-84), 'DateFieldFormatHere')))<$(=Date(Max(WeekFlag), 'DateFieldFormatHere'))"}>}WeekFlag),

If(GetSelectedCount(QuarterFlag) > 0, GetFieldSelections(QuarterFlag), GetFieldSelections(WeekFlag)))

Not applicable
Author

Hi Sunny,

Thanks for the reply.

the above exp i am using at limitation, need to show only latest 12 weeks data.

Count({$<WeekFlag={">=$(=(Max(WeekFlag))-84)}<$(=(Max(WeekFlag)))"}>}WeekFlag), -- here can i use weekflag again, i am little bit confusion..is it show last 12 weeks

Regards,

Subba

sunny_talwar

You are using at limitation? What do you when you say latest 12 weeks data and last 12 weeks data? Do you mean different things here? I am confused of what you are looking for.

Like before fix the the curly bracket

Count({$<WeekFlag={">=$(=(Max(WeekFlag)-84)))<$(=(Max(WeekFlag)))"}>}WeekFlag)