Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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.
Not applicable

User field depended condition in expression

Hi,

I have list with dates and diagram where I need to get sum of values where date less or equal to date selected in list box.

for example:

I have data like this

data.date

data.value

the list shows data.date in month format

the expression in diagram I need is somthing like:

Sum(

    if(

          data.date <= (valueSelectedInList),

          ByMonthPlan.Value,

          0)

)

If anyone know the way how to do it, please help.

1 Solution

Accepted Solutions
Not applicable

Re: User field depended condition in expression

I added variable selectedDateString '=(max({dateState}data.date))'

and the expressions:

Sum( TOTAL

    if(

        data.date <= selectedDateString,

        data.Value,

        0

    )

do work

3 Replies
Not applicable

Re: User field depended condition in expression

Could you try:

Sum(

    if(

          data.date = (GetFieldSelections(Items.Code)),

          ByMonthPlan.Value,

          0)

)

Not applicable

Re: User field depended condition in expression

Yes, I was tryed GetFieldSelections() with various arguments but I can't get any value.

Now I find way to get selected value but still can't use it in expression.

I put list in to {dateState} set and (max({dateState}data.date)) returns correct result

but expression returns nothing:

Sum( TOTAL

    if(

        data.date <= (max({dateState}data.date)),

        data.Value,

        0

    )

any way thanks for the answer.

Not applicable

Re: User field depended condition in expression

I added variable selectedDateString '=(max({dateState}data.date))'

and the expressions:

Sum( TOTAL

    if(

        data.date <= selectedDateString,

        data.Value,

        0

    )

do work

Community Browser