Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Venancioe
Contributor
Contributor

Percentage Variance on Table

In my situation I have a line in which each column represents the revenue of each day for a product, I want to obtain the variance in percentage. For example, In the total revenue of products for those days, I want to know what is the percentage of each day in the total sum.

Ex: Total sum of DATE revenue for the days is 100, and for each day I have values like 20, 40, 10, 30. I need to know what is the percentage of each of these values in the total sum of each product

Screenshot_1.png

 

Labels (3)
24 Replies
Venancioe
Contributor
Contributor
Author

Hi @NageshSG 

is possible to share a qvf  instead of qvw file?

 

Venancioe
Contributor
Contributor
Author

Hi.

Thanks Is possible to share a qvf  instead of qvw file?

 

NageshSG
Partner - Contributor III
Partner - Contributor III

Hi @Venancioe 

Please see attached qvf file.

Please note the script logic is the same except for the connection strings.

Make sure to change the connection strings to your local folder location and update the variable 'vsampledata' before you trigger the reload.

Regards.

Venancioe
Contributor
Contributor
Author

Thanks.

How did you calculate the NextDateRevenue?

NageshSG
Partner - Contributor III
Partner - Contributor III

Hi @Venancioe 

Two ways of calculating the "NextDateRevenue".

1. In the front end i have used 'Above' function in the chart but has limitations.

2. Script side >> by creating an additional calculated column using the "Previous" function which evaluates the previous record value against the current record value. Make sure the table is sorted in the correct order for this to work ie. Date descending within each Product (ie. sorted by Product first). This way Previous record will always have Date which is cur record date + 1 for each Product. See the screen shot below how i used it in the script.

NageshSG_0-1629884526245.png

Hope this helps.

Regards.