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.
d_caprelli
Contributor II

Table calculation condition

Hi i have a Table with my rows, i want in it make a condition when i select che month connect to it (The month i choice is the field MESEFINEFORN)

When i click on my choice MESEFINEFORN i want the table will be filter for it, and all is good, is simple..... but in the same time i want my table will be filter for this condition:  D_FINE_VAL>D_FINE_FORN   (are two dates

so i set in my calculation condition this: =GetFieldSelections(D_FINE_VAL)>GetFieldSelections(D_FINE_FORN)

but i see this is not function..... like you see in the picture, where is the fault?

1 Solution

Accepted Solutions
d_caprelli
Contributor II

Re: Table calculation condition

Hi i solved it, the solution is this, if it can be helpful for someone:

Sum({<D_FINE_VAL={"=D_FINE_VAL<=D_FINE_FORN"}, MESEFINEVAL = {"$(=MaxString(MESEFINEVAL))"}>}CONSUMO_TOT_ANNUO)

10 Replies
d_caprelli
Contributor II

Re: Table calculation condition

Nobody can help me? Is impossible to do that in QlikView? how to filter a table OR a chart in this way?

Thanks

Digvijay_Singh
Honored Contributor III

Re: Table calculation condition

Try this in your measure expression -

Sum({<D_FINE_VAL={"=D_FINE_VAL>D_FINE_FORN "}>}Sales)

or

Sum(if(D_FINE_VAL>D_FINE_FORN,Sales)) - But this will be slower than set analysis one

d_caprelli
Contributor II

Re: Table calculation condition

Hi thanks you for your reply, but i see when i put the expression, it not change the result; i attach there a file .xls so you can try do make an example.

I put the expression, like you see in the image, but nothing.....

MVP
MVP

Re: Table calculation condition

I am not sure if I have completely understood your issue, but it looks to me like you are using the incorrect object. A Table Box allows not calculations - it simply displays the distinct combinations of the selected fields. The calclation condition (Condizione di Calcolo) determine whether the table as a whole is generated. This is usually used to prevent runaway and costly generation of huge tables.

You probably need a straight or pivot table. Choose a set of dimensions and then place the conditions in the measurements. Something like

     Sum(If(D_FINE_VAL>D_FINE_FORN, AMOUNT))

     or

     Sum({<ACCOUNT = {"=D_FINE_VAL>D_FINE_FORN"} >} AMOUNT)


Note that you will need to edit the above examples for your particular requirements.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
d_caprelli
Contributor II

Re: Table calculation condition

ah i think i understand.... but if i need to do this kind of expression?

D_FINE_VAL<= D_FINE_FORN  and contemporary time D_FINE_VAL = Max of the Month i choice in selection?

the month i choice in selection is the month extract from the field D_FINE_VAL

MVP
MVP

Re: Table calculation condition

>> but if i need to do this kind of expression?

Hard to say without more information.

>>D_FINE_VAL<= D_FINE_FORN  and contemporary time D_FINE_VAL = Max of the Month i choice in selection?

Not sure what you mean here, I am afraid.

Can you create a small sample qvw document with some representative data and the table you want restricted?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
d_caprelli
Contributor II

Re: Table calculation condition

not be afraid :-)

i want to do an expression like this:

D_FINE_VAL<= D_FINE_FORN  and in same time D_FINE_VAL = Max of the Month i choice in selection


i know for first expression i can do some like this:

Sum({<D_FINE_VAL={"=D_FINE_VAL<=D_FINE_FORN "}>}CONSUMO_TOT_ANNUO)


i wanna add to that the: D_FINE_VAL = Max(of the Month i choice in selection)


The month i choose in the selection is this:

is my field "MESEFINEVAL"

Digvijay_Singh
Honored Contributor III

Re: Table calculation condition

May be something like this -

Sum({<D_FINE_VAL={"=D_FINE_VAL<=D_FINE_FORN "},MESEFINEVAL={"$(=Max(MESEFINEVAL))"}>}CONSUMO_TOT_ANNUO)

d_caprelli
Contributor II

Re: Table calculation condition

no in this way it not take out nothing, how can i add in my expression:

Sum({<D_FINE_VAL={"=D_FINE_VAL<=D_FINE_FORN "}>}CONSUMO_TOT_ANNUO)


addthe: D_FINE_VAL = Max(of the Month i choose in selection)


The month i choose in the selection is this:

is my field "MESEFINEVAL"

Community Browser