Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
danosoft
Specialist
Specialist

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
danosoft
Specialist
Specialist
Author

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)

View solution in original post

10 Replies
danosoft
Specialist
Specialist
Author

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

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

danosoft
Specialist
Specialist
Author

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

jonathandienst
Partner - Champion III
Partner - Champion III

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
danosoft
Specialist
Specialist
Author

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

jonathandienst
Partner - Champion III
Partner - Champion III

>> 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
danosoft
Specialist
Specialist
Author

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

May be something like this -

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

danosoft
Specialist
Specialist
Author

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"