Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
vardhancse
Specialist III
Specialist III

Calculated dimension

Hi Team have a requirement is that I have multiple tables, now i need to create one calculated field in each table the logic is that

  

Regioncount
Total Count1000
America100
India200
china300
Japan400
Additional Field0

Additional field logic: =(B3+B4+B5+B6)-B2

Nothing but =sum(America+India+china+Japan)-Total count

This should happen dynamically means how many numbers of rows for Region the calculation should happen

6 Replies
Gysbert_Wassenaar

I don't think you should try to create a calculated dimension for this. That will get very ugly in very short time. Try adding something like this to your script:

ReportDimension:

LOAD * INLINE [

    CalculatedRegion, Region, Multiplier

    Total Count, Total Count, 1

    America, America, 1

    India, India, 1

    china, china, 1

    Japan, Japan, 1

    Additional Field, Total Count, -1

    Additional Field, America, 1

    Additional Field, India, 1

    Additional Field, china, 1

    Additional Field, Japan, 1

];

You can then use CalculatedRegion as dimension and sum(count*Multiplier) as expression.


talk is cheap, supply exceeds demand
vardhancse
Specialist III
Specialist III
Author

Hi Gysbert,

Thanks for your reply,

Requirement is that the value region will have so many values and we can not create inline table for the same.

Can please let me know is there any alternate method for my requirement.

Gysbert_Wassenaar

Then create the table from the source data. The Inline Load I posted is just an example of the kind of table you need.


talk is cheap, supply exceeds demand
vardhancse
Specialist III
Specialist III
Author

Hi Gysbert,

Is there a way to use the expression total value and create one more additional field as a dimension.

Gysbert_Wassenaar

Yes, there is and you shouldn't try it. Like mama said: "If you don't know how to do that, maybe you shouldn't."

If you want to try anyway have a look at the ValueList function.


talk is cheap, supply exceeds demand
vardhancse
Specialist III
Specialist III
Author

Thanks Gysbert,

But any way will try once the ValueList function.

in the same chart we cannon use Valuelist function and can create calculated field,is that correct please correct me if I was wrong.